From e21656413a73a25796ec67122e3bb2ed60f5ba32 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Fri, 9 Aug 2019 09:06:10 +0000 Subject: [PATCH] [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) --- addons/product_matrix/models/product_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product_matrix/models/product_template.py b/addons/product_matrix/models/product_template.py index 64b164e51e6..60fccea14a3 100644 --- a/addons/product_matrix/models/product_template.py +++ b/addons/product_matrix/models/product_template.py @@ -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 '- '