Skip to content

Commit

Permalink
[FIX] website: current website caching
Browse files Browse the repository at this point in the history
Not taking fallback in account means incorrect values can get cached/retrieved
on fallback v not fallback cases
  • Loading branch information
xmo-odoo committed Oct 19, 2018
1 parent 7853794 commit 50f54c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/website/models/website.py
Expand Up @@ -467,7 +467,7 @@ def get_current_website(self, fallback=True):
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')
Expand Down

0 comments on commit 50f54c9

Please sign in to comment.