diff options
| author | Jeremy Kersten <jke@odoo.com> | 2020-03-26 18:07:20 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2020-03-26 18:12:47 +0000 |
| commit | 26c4de2f18be2b4e944ee255236d9a5a1710d94c (patch) | |
| tree | 80e8ccc73369b1d825ee4161f8c32cb57a1048b5 /addons/http_routing | |
| parent | a65d27cce98c1b0d303eeaf8f066fe4983afc7a8 (diff) | |
[IMP] http_routing: use cached code from lang
In case of short controller that don't use qweb template, we don't need
anyhting else that this url code that don't change frequently.
It make only sense for model like lang, website, ... that will not change
frequently. And are called on each call by the dispatcher.
In case of a website page, we will btw browse lang later, but in case of
small controller like /favicon.ico, or page without qweb, ... we can just
use the same from last query.
Diffstat (limited to 'addons/http_routing')
| -rw-r--r-- | addons/http_routing/models/ir_http.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/http_routing/models/ir_http.py b/addons/http_routing/models/ir_http.py index 5469310228f..c0fd4a46a19 100644 --- a/addons/http_routing/models/ir_http.py +++ b/addons/http_routing/models/ir_http.py @@ -411,7 +411,7 @@ class IrHttp(models.AbstractModel): lang = preferred_lang or cls._get_default_lang() request.lang = lang - context['lang'] = lang.code + context['lang'] = lang._get_cached('code') # bind modified context request.context = context |
