From c9041e8dcfbfe93676f4d2cb1bf96e512afbac38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Warnon?= Date: Wed, 10 Oct 2018 06:24:25 +0000 Subject: [PATCH] [FIX] (website_)sale: hide single attribute value in p. configurator Targets commit d3530eb07e24278117ab396ecb86a59deecc312d References task id 1892022 Purpose ======= - When there is only one attribute value for an attribute configured in a product's variants, it should be hidden in the product configurator. e.g: The only value selected for the "Material" attribute is the "Wood" value for the "Customizable Desk". The radio selection is hidden and "Material: Wood" is displayed in the product's description. - Fixed a class name typo closes odoo/odoo#27604 --- addons/sale/models/product_product.py | 2 +- addons/sale/views/sale_product_configurator_templates.xml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/sale/models/product_product.py b/addons/sale/models/product_product.py index 87e160673e9..027a371dc8a 100644 --- a/addons/sale/models/product_product.py +++ b/addons/sale/models/product_product.py @@ -75,7 +75,7 @@ class ProductAttributeValue(models.Model): attribute type is 'Color'.""") -class ProductProductAttributeValue(models.Model): +class ProductTemplateAttributeValue(models.Model): _inherit = "product.template.attribute.value" html_color = fields.Char('HTML Color Index', related="product_attribute_value_id.html_color") diff --git a/addons/sale/views/sale_product_configurator_templates.xml b/addons/sale/views/sale_product_configurator_templates.xml index 99c89a03f29..5dcb37fc8e1 100644 --- a/addons/sale/views/sale_product_configurator_templates.xml +++ b/addons/sale/views/sale_product_configurator_templates.xml @@ -177,7 +177,10 @@