[IMP] product: only display attributes with multiple possible values
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user