diff --git a/models/sale_order.py b/models/sale_order.py index 37dbf78e578c1fe5092f14970e1f07ffd393baba..2ebe2fc9f03fd5f3c47e217a0a04afcf6e6543da 100644 --- a/models/sale_order.py +++ b/models/sale_order.py @@ -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()