[FIX] product_matrix : templates with one attribute line.

Don't show "Not Available" as Line header when there is only one
attribute line on the product.template.

closes odoo/odoo#35586

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
Victor Feyens
2019-08-09 09:06:10 +00:00
parent 1e61522d19
commit e21656413a
@@ -75,8 +75,8 @@ class ProductTemplateAttributeValue(models.Model):
:rtype: dict
"""
header_cell = {
'name': '-'.join([attr.name for attr in self])
}
'name': '-'.join([attr.name for attr in self]) if self else " "
} # The " " is to avoid having 'Not available' if the template has only one attribute line.
extra_price = sum(self.mapped('price_extra')) if display_extra else 0
if extra_price:
sign = '+ ' if self.price_extra > 0 else '- '