From e0d4dd01cc44261930bfd77d5b6cd651c13fbc75 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 9 Sep 2016 09:29:00 +0200 Subject: [PATCH] [FIX] website_sale: toggle shipping state display In 1ef52c9c the code displaying state of a given country was improved for some incompatibilities. But, if when setting the billing informations we choose to create a new shipping address, the shipping state* would not be displayed even when it should be (currently, if the shipping country is Australia or U.S.). opw-687948 *a state being a subdivision of a country --- addons/website_sale/static/src/js/website_sale.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index 5d01e05759e..cb78afe7e9f 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -332,7 +332,7 @@ $('.oe_website_sale').each(function () { $('input.js_variant_change, select.js_variant_change', this).first().trigger('change'); }); - var state_options = $("select[name='state_id']:enabled option:not(:first)"); + var state_options = $("select[name='state_id'] option:not(:first)"); $(oe_website_sale).on('change', "select[name='country_id']", function () { var select = $("select[name='state_id']"); state_options.detach(); @@ -342,7 +342,7 @@ $('.oe_website_sale').each(function () { }); $(oe_website_sale).find("select[name='country_id']").change(); - var shipping_state_options = $("select[name='shipping_state_id']:enabled option:not(:first)"); + var shipping_state_options = $("select[name='shipping_state_id'] option:not(:first)"); $(oe_website_sale).on('change', "select[name='shipping_country_id']", function () { var select = $("select[name='shipping_state_id']"); shipping_state_options.detach();