Skip to content
Extraits de code Groupes Projets
Valider 96789756 rédigé par jordan's avatar jordan
Parcourir les fichiers

[fix] error on group by project

parent e39137ab
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -30,17 +30,20 @@ class SaleIntervention(models.Model): ...@@ -30,17 +30,20 @@ class SaleIntervention(models.Model):
and pricelist.item_ids.filtered(lambda i: i.categ_id == plant_categ_id) and pricelist.item_ids.filtered(lambda i: i.categ_id == plant_categ_id)
and self.env.user.company_id.vat and self.env.user.company_id.vat
): ):
quantity = ( interventions = self.project_id.intervention_ids.filtered(
self.intervention_length lambda i: i.intervention_type_id == self.intervention_type_id
)
quantity = 0
price = 0
for inter in interventions:
quantity += (
inter.intervention_length
if product_tmpl.uom_name == "m" if product_tmpl.uom_name == "m"
else self.plant_qty else inter.plant_qty
) )
price += inter.price
if quantity != 0: if quantity != 0:
price_unit = self.price / quantity price_unit = price / quantity
# data = {
# "price_unit": price_unit,
# "product_uom_qty": quantity,
# }
plant_pricelist_item = pricelist.item_ids.filtered( plant_pricelist_item = pricelist.item_ids.filtered(
lambda i: i.categ_id == plant_categ_id lambda i: i.categ_id == plant_categ_id
) )
......
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