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