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

[FIX] do not remove lines not from interventions

parent 4bedb39f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -27,16 +27,17 @@ class SaleOrder(models.Model):
# Business method
# ------------------------------------------------------
def clean_sale_order(self):
current_inter = list()
inter_list = list()
for project in self.sale_project_ids:
for inter in project.intervention_ids:
current_inter.append(
inter_list.append(
(project.id, inter.intervention_type_id.product_variant_id.id)
)
for sol in self.order_line:
if (
sol.product_id
and (sol.sale_project_id.id, sol.product_id.id) not in current_inter
sol.sale_project_id
and sol.product_id
and (sol.sale_project_id.id, sol.product_id.id) not in inter_list
):
sol.unlink()
......
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