From 164b8ed01a96c860cf758514abfd50ba349e990c Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 16 Nov 2016 14:51:28 +0100 Subject: [PATCH] [FIX] website_sale: Set the selected state in the visible select tag When there is a shipping address, this is the second select tag which is used(defined in website_same_delivery/views/website_same_delivery.xml) opw:693127 --- 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 1dac377270e..a48483b5349 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -335,9 +335,9 @@ $('.oe_website_sale').each(function () { $('input.js_variant_change, select.js_variant_change', this).first().trigger('change'); }); - var state_options = $("select[name='state_id'] option:not(:first)"); + var state_options = $("select[name='state_id']:visible option:not(:first)"); $(oe_website_sale).on('change', "select[name='country_id']", function () { - var select = $("select[name='state_id']"); + var select = $("select[name='state_id']:visible"); var selected_state = select.val(); state_options.detach(); var displayed_state = state_options.filter("[data-country_id="+($(this).val() || 0)+"]");