[FIX] website: current website caching

Not taking fallback in account means incorrect values can get cached/retrieved
on fallback v not fallback cases

closes odoo/odoo#27989
This commit is contained in:
Xavier Morel
2018-10-19 15:28:43 +00:00
parent 1dcddbd022
commit 238e561ad9
+1 -1
View File
@@ -467,7 +467,7 @@ class Website(models.Model):
website_id = self._get_current_website_id(domain_name, country_id, fallback=fallback)
return self.browse(website_id)
@tools.cache('domain_name', 'country_id')
@tools.cache('domain_name', 'country_id', 'fallback')
def _get_current_website_id(self, domain_name, country_id, fallback=True):
# sort on country_group_ids so that we fall back on a generic website (empty country_group_ids)
websites = self.search([('domain', '=', domain_name)]).sorted('country_group_ids')