diff options
| author | fwi-odoo <fwi@odoo.com> | 2016-08-03 10:33:49 +0200 |
|---|---|---|
| committer | David Monjoie <dmo@odoo.com> | 2016-08-22 13:39:41 +0200 |
| commit | e36db7a7afb5b36a75f715b314eb956a1cbc1046 (patch) | |
| tree | a965f63d59741aff769a65ad415ef90590080261 | |
| parent | 2adae8ff0f530ce219570bd27610561b42dbc55a (diff) | |
[IMP] product: only display attributes with multiple possible values
| -rw-r--r-- | addons/product/models/product.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/product/models/product.py b/addons/product/models/product.py index 221a62595c2..0d9207a44d9 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -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: |
