From ea8f7a384dc376820dc56c9d51d52edd620cb17a Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Fri, 16 Jul 2021 13:04:25 +0000 Subject: [PATCH] [FIX] web: fallback for cache_hashes when http_routing is not installed Previously, loading the login page with no modules installed would result in a crash, because the translation service assumed that there was always a cache_hashes key in the session info. This is not the case when the http_routing module is not installed. This module fixes that by adding a fallback for those cache_hashes in the translation service. closes odoo/odoo#73874 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/core/l10n/localization_service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/core/l10n/localization_service.js b/addons/web/static/src/core/l10n/localization_service.js index bca3fd6609b..893e8049561 100644 --- a/addons/web/static/src/core/l10n/localization_service.js +++ b/addons/web/static/src/core/l10n/localization_service.js @@ -10,7 +10,7 @@ import { session } from "@web/session"; export const localizationService = { dependencies: ["user"], start: async (env, { user }) => { - const cacheHashes = session.cache_hashes; + const cacheHashes = session.cache_hashes || {}; const translationsHash = cacheHashes.translations || new Date().getTime().toString(); const lang = user.lang || null; const translationURL = session.translationURL || "/web/webclient/translations";