From c0dffa343345ef49df2726adbd32bfbab2dd31a3 Mon Sep 17 00:00:00 2001 From: amoyaux Date: Fri, 17 Feb 2017 12:15:59 +0100 Subject: [PATCH] [FIX] Website_Sale: State / Province doesn't appear when needed. Use case when it happens: * Go to billing for a product in website * Modify or create an address * Select a country without state * State field disappear * Select a country with states * State field doesn't appear -> Bug If you confirm, it raises an error asking you to fill the state field and this one reappear. The bug come from this forward port 1ef4061e68 This fix removes :visible from the jquery selector on state tag selector since the logic is different in version 10. opw-707402 --- addons/website_sale/static/src/js/website_sale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index 11e26de4f6b..51029495c36 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -395,7 +395,7 @@ odoo.define('website_sale.website_sale', function (require) { //$("input[name='phone']").attr('placeholder', data.phone_code !== 0 ? '+'+ data.phone_code : ''); // populate states and display - var selectStates = $("select[name='state_id']:visible"); + var selectStates = $("select[name='state_id']"); // dont reload state at first loading (done in qweb) if (selectStates.data('init')===0 || selectStates.find('option').length===1) { if (data.states.length) {