Skip to content
Snippets Groups Projects
Commit a1d2893f authored by Victor Feyens's avatar Victor Feyens
Browse files

[FIX] *_product_matrix: use correct record for comparison.

parent 127a75ed
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ class PurchaseOrder(models.Model):
product = product_template._create_product_variant(combination)
# TODO replace the check on product_id by a first check on the ptavs and pnavs?
# and only create/require variant after no line has been found ???
order_lines = self.order_line.filtered(lambda line: line.product_id == product and line.product_no_variant_attribute_value_ids == no_variant_attribute_values)
order_lines = self.order_line.filtered(lambda line: (line._origin or line).product_id == product and (line._origin or line).product_no_variant_attribute_value_ids == no_variant_attribute_values)
# if product variant already exist in order lines
old_qty = sum(order_lines.mapped('product_qty'))
......
......@@ -55,7 +55,7 @@ class SaleOrder(models.Model):
# create or find product variant from combination
product = product_template._create_product_variant(combination)
order_lines = self.order_line.filtered(lambda line: line.product_id == product and line.product_no_variant_attribute_value_ids == no_variant_attribute_values)
order_lines = self.order_line.filtered(lambda line: (line._origin or line).product_id == product and (line._origin or line).product_no_variant_attribute_value_ids == no_variant_attribute_values)
# if product variant already exist in order lines
old_qty = sum(order_lines.mapped('product_uom_qty'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment