[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) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
This commit is contained in:
Jason Van Malder
2020-07-27 14:49:18 +00:00
parent cc6000abfa
commit 974bc0d2df
@@ -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);