Skip to content
Extraits de code Groupes Projets
Valider 6b43c3a2 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[IMP] manage cubic meter uom on mulch

parent eed34396
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -549,7 +549,9 @@ class SaleIntervention(models.Model): ...@@ -549,7 +549,9 @@ class SaleIntervention(models.Model):
@api.onchange("plant_qty", "intervention_length", "mulch_id") @api.onchange("plant_qty", "intervention_length", "mulch_id")
def _onchange_mulch_id(self): def _onchange_mulch_id(self):
self.mulch_has_staples = False self.mulch_has_staples = False
if self.mulch_unit == self.env.ref("uom.product_uom_meter"): if self.mulch_unit == self.env.ref(
"uom.product_uom_meter"
) or self.much_unit == self.env.ref("uom.product_uom_cubic_meter"):
self.mulch_qty = self.intervention_length self.mulch_qty = self.intervention_length
elif self.mulch_unit == self.env.ref("uom.product_uom_unit"): elif self.mulch_unit == self.env.ref("uom.product_uom_unit"):
self.mulch_qty = self.plant_qty self.mulch_qty = self.plant_qty
...@@ -560,7 +562,9 @@ class SaleIntervention(models.Model): ...@@ -560,7 +562,9 @@ class SaleIntervention(models.Model):
@api.onchange("plant_qty", "intervention_length", "mulch2_id") @api.onchange("plant_qty", "intervention_length", "mulch2_id")
def _onchange_mulch2_id(self): def _onchange_mulch2_id(self):
self.mulch2_has_staples = False self.mulch2_has_staples = False
if self.mulch2_unit == self.env.ref("uom.product_uom_meter"): if self.mulch_unit == self.env.ref(
"uom.product_uom_meter"
) or self.much_unit == self.env.ref("uom.product_uom_cubic_meter"):
self.mulch2_qty = self.intervention_length self.mulch2_qty = self.intervention_length
elif self.mulch2_unit == self.env.ref("uom.product_uom_unit"): elif self.mulch2_unit == self.env.ref("uom.product_uom_unit"):
self.mulch2_qty = self.plant_qty self.mulch2_qty = self.plant_qty
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter