From 974bc0d2df33850320d1363e8060131d194e4bb6 Mon Sep 17 00:00:00 2001 From: Jason Van Malder Date: Mon, 27 Jul 2020 12:45:47 +0000 Subject: [PATCH] [FIX] sale: fix safari excluded variant indistinguishable in select Issue - Safari - Sales with product configurator - Have a product with color black & white size M, XL - Exclude M size when color is white - Create a SO with that product - Select white color The size's M option is not grayed in the select Cause We do not disable the option when it's not available. We are just adding a css class which grays the option. Safari ignores the style Solution Since the flow can't be completed if you select a grayed item, disable the option OPW-2289666 closes odoo/odoo#54993 X-original-commit: 6150311b72089e3fbae6bc27551bc7f4792e68dd Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: Jason Van Malder (jvm) --- addons/sale/static/src/js/variant_mixin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale/static/src/js/variant_mixin.js b/addons/sale/static/src/js/variant_mixin.js index 147a54a5e79..ff4007f9b0b 100644 --- a/addons/sale/static/src/js/variant_mixin.js +++ b/addons/sale/static/src/js/variant_mixin.js @@ -341,6 +341,7 @@ var VariantMixin = { $parent .find('option, input, label') .removeClass('css_not_available') + .prop('disabled', false) .attr('title', '') .data('excluded-by', ''); @@ -413,6 +414,7 @@ var VariantMixin = { .find('option[value=' + attributeValueId + '], input[value=' + attributeValueId + ']'); $input.addClass('css_not_available'); $input.closest('label').addClass('css_not_available'); + $input.prop('disabled', true); if (excludedBy && attributeNames) { var $target = $input.is('option') ? $input : $input.closest('label').add($input);