From 601795ba4e0255765a029ae38583a8dfcb648475 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Fri, 21 Feb 2020 13:22:37 +0000 Subject: [PATCH] [FIX] website_sale: load states according to address mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Step to reproduce: - Install delivery and restrict your delivery to a few states - Edit an already existing shipping address in checkout which is set to a country having restricted states in the delivery method - The states listed in the address shipping page are not the restricted ones but all states. Related to #26530 closes odoo/odoo#45948 Signed-off-by: Jérémy Kersten (jke) --- addons/website_sale/controllers/main.py | 2 +- addons/website_sale/views/templates.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index db106f9bf15..1269580d479 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -716,8 +716,8 @@ class WebsiteSale(http.Controller): 'checkout': values, 'can_edit_vat': can_edit_vat, 'country': country, + 'country_states': country.get_website_sale_states(mode=mode[1]), 'countries': country.get_website_sale_countries(mode=mode[1]), - "states": country.get_website_sale_states(mode=mode[1]), 'error': errors, 'callback': kw.get('callback'), 'only_services': order and order.only_services, diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index cceeb6e689f..f6595be4b37 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -1254,7 +1254,7 @@