From bc0cd0bb56cd6edb049d8830f45a39d3fcc692c6 Mon Sep 17 00:00:00 2001 From: Sergey Shebanin Date: Thu, 3 Nov 2022 14:15:18 +0000 Subject: [PATCH] [FIX] web: translations hash don't consider all loaded modules Only server wide modules are being taken into account when calculating translations hash. So user probably can't get translations of new installed modules unless it is forced by hard page reload (Ctrl+Shift+R). Problem exists since https://github.com/odoo/odoo/commit/80d74e7ee0eab83dc5100e0776df09d04b882fec and the cause in that `mods = odoo.conf.server_wide_modules or []` string was unpaired with the following `if` statement during refactoring. This commit restores computation of hash based on all loaded modules. closes odoo/odoo#105466 X-original-commit: 859cd0463aec4533df30e4839367832fef0685fd Signed-off-by: Xavier Morel (xmo) --- addons/web/models/ir_http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/models/ir_http.py b/addons/web/models/ir_http.py index 8ebc6dc1f8a..d8f3fa4bf85 100644 --- a/addons/web/models/ir_http.py +++ b/addons/web/models/ir_http.py @@ -82,6 +82,8 @@ class Http(models.AbstractModel): default=128 * 1024 * 1024, # 128MiB )) mods = odoo.conf.server_wide_modules or [] + if request.db: + mods = list(request.registry._init_modules) + mods session_info = { "uid": session_uid, "is_system": user._is_system() if session_uid else False, @@ -120,8 +122,6 @@ class Http(models.AbstractModel): # but is still included in some other calls (e.g. '/web/session/authenticate') # to avoid access errors and unnecessary information, it is only included for users # with access to the backend ('internal'-type users) - if request.db: - mods = list(request.registry._init_modules) + mods menus = request.env['ir.ui.menu'].load_menus(request.session.debug) ordered_menus = {str(k): v for k, v in menus.items()} menu_json_utf8 = json.dumps(ordered_menus, default=ustr, sort_keys=True).encode()