From d59fe9c58c2dcc2bf6613adb7ac3662597b50496 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 5 Mar 2018 15:22:47 +0100 Subject: [PATCH] [FIX] website_sale_delivery: if state_ids is not specified, all states supported Set up a delivery method that has a country set on it, but no states (e.g. USA) When the client is required to fill his address info in and when he chooses USA as the country Before this commit: The selection field where the states are selectable is not displayed. After this commit: All the states of the country are selectable The usability choice is to say that if states are not specified on the delivery method that means all states are supported OPW 1818591 --- addons/website_sale_delivery/models/res_country.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/website_sale_delivery/models/res_country.py b/addons/website_sale_delivery/models/res_country.py index 8b4648a7105..601ac731787 100644 --- a/addons/website_sale_delivery/models/res_country.py +++ b/addons/website_sale_delivery/models/res_country.py @@ -35,5 +35,7 @@ class ResCountry(models.Model): states = res break states |= carrier.state_ids + if not states: + states = states.search([('country_id', '=', self.id)]) res = res & states return res