From 3e0c80270d5725fcd1d389b75669c382157fc474 Mon Sep 17 00:00:00 2001 From: "Valentin Vallaeys (vava)" Date: Wed, 19 Oct 2022 08:12:34 +0000 Subject: [PATCH] [FIX] product,web: color_field fixes for product variant color There was a typo in the color_field xml not allowing to disable the pop-up in case of readonly. A test validates the feature is active. The color_field now displays the transparent symbol (instead of black color) in case the color is undefined. The product configurator also displays the transparent symbol for undefined non-custom colors. task-3013110 closes odoo/odoo#106669 X-original-commit: c67c32c2dbe10b4885ec1177852839b3d18ecf05 Signed-off-by: Victor Feyens (vfe) Signed-off-by: Vallaeys Valentin (vava) --- .../static/src/scss/product_configurator.scss | 4 +++ addons/sale/views/variant_templates.xml | 2 +- .../src/views/fields/color/color_field.js | 4 +-- .../src/views/fields/color/color_field.xml | 4 +-- .../tests/views/fields/color_field_tests.js | 27 ++++++++++++++++--- 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/addons/sale/static/src/scss/product_configurator.scss b/addons/sale/static/src/scss/product_configurator.scss index 7538018795a..2044539eb6f 100644 --- a/addons/sale/static/src/scss/product_configurator.scss +++ b/addons/sale/static/src/scss/product_configurator.scss @@ -31,6 +31,10 @@ &.custom_value { background-image: linear-gradient(to bottom right, #FF0000, #FFF200, #1E9600); } + + &.transparent { + background-image: url(/web/static/img/transparent.png); + } } .css_not_available_msg { diff --git a/addons/sale/views/variant_templates.xml b/addons/sale/views/variant_templates.xml index bca394f00bd..af0d8674ab6 100644 --- a/addons/sale/views/variant_templates.xml +++ b/addons/sale/views/variant_templates.xml @@ -95,7 +95,7 @@