[IMP] product: only display attributes with multiple possible values

This commit is contained in:
fwi-odoo
2016-08-22 13:39:41 +02:00
committed by David Monjoie
parent 2adae8ff0f
commit e36db7a7af
+4 -1
View File
@@ -376,7 +376,10 @@ class ProductProduct(models.Model):
result = []
for product in self.sudo():
variant = ", ".join([v.name for v in product.attribute_value_ids])
# display only the attributes with multiple possible values on the template
variable_attributes = product.attribute_line_ids.filtered(lambda l: len(l.value_ids) > 1).mapped('attribute_id')
variant = ", ".join([v.name for v in product.attribute_value_ids if v.attribute_id in variable_attributes])
name = variant and "%s (%s)" % (product.name, variant) or product.name
sellers = []
if partner_ids: