[FIX] sale: variant attribute description partially duplicated.

Since the name updates are done in onchanges, the relational values
may be newIds and therefore we have to use their _origin for comparisons.

closes odoo/odoo#42217

X-original-commit: 9c303bfd4f8eeb1c6892349c59f70347a11ff71f
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2019-12-19 18:08:55 +00:00
parent febd360ff0
commit 5015e718fb
+4 -3
View File
@@ -1704,11 +1704,12 @@ class SaleOrderLine(models.Model):
name = "\n"
custom_values = self.product_custom_attribute_value_ids.custom_product_template_attribute_value_id
custom_ptavs = self.product_custom_attribute_value_ids.custom_product_template_attribute_value_id
no_variant_ptavs = self.product_no_variant_attribute_value_ids._origin
# display the no_variant attributes, except those that are also
# displayed by a custom (avoid duplicate)
for ptav in (self.product_no_variant_attribute_value_ids - custom_values):
# displayed by a custom (avoid duplicate description)
for ptav in (no_variant_ptavs - custom_ptavs):
name += "\n" + ptav.display_name
# display the is_custom values