diff --git a/addons/purchase_product_matrix/models/purchase.py b/addons/purchase_product_matrix/models/purchase.py index bb55063e097..13023640b2f 100644 --- a/addons/purchase_product_matrix/models/purchase.py +++ b/addons/purchase_product_matrix/models/purchase.py @@ -98,10 +98,12 @@ class PurchaseOrder(models.Model): product_no_variant_attribute_value_ids=no_variant_attribute_values.ids) )) if new_lines: + res = False self.update(dict(order_line=new_lines)) for line in self.order_line.filtered(lambda line: line.product_template_id == product_template): - line._product_id_change() + res = line._product_id_change() or res line._onchange_quantity() + return res def _get_matrix(self, product_template): def has_ptavs(line, sorted_attr_ids): diff --git a/addons/sale_product_matrix/models/sale_order.py b/addons/sale_product_matrix/models/sale_order.py index a504416274c..6ce55c5ddf0 100644 --- a/addons/sale_product_matrix/models/sale_order.py +++ b/addons/sale_product_matrix/models/sale_order.py @@ -109,12 +109,13 @@ class SaleOrder(models.Model): product_no_variant_attribute_value_ids=no_variant_attribute_values.ids) )) if new_lines: + res = False self.update(dict(order_line=new_lines)) for line in self.order_line.filtered(lambda line: line.product_template_id == product_template): - line.product_id_change() + res = line.product_id_change() or res line._onchange_discount() line._onchange_product_id_set_customer_lead() - + return res def _get_matrix(self, product_template): """Return the matrix of the given product, updated with current SOLines quantities.