From 80379606dbc7d4afdb22476eea97a28ed88fe497 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 18 Jun 2020 15:01:19 +0000 Subject: [PATCH] [REV] Revert c43647f: "[FIX] odoo: Traceback when creating a new contact" This reverts commit c43647f085a7f62c9c81db6553be6a6e402943d0. That change was not tested properly and can cause unforeseen errors because it has far-reaching consequences, modifying the fallback language on all requests. One of the consequences is an alteration of the behavior of the translation function `_()` due to the absence of a default language. For users with no language set, it will now translate False/None values as False/None, rather than the empty string fallback. Code that was not prepared to deal with those non-str translations will now crash. Besides, 'en_US' is a hardcoded default used in many areas of the code, and we cannot get rid of it like this, especially in a stable series. Cfr #52758 closes odoo/odoo#53273 X-original-commit: e220c5a28ecbd160be86b0ce00a7f17bcfaa816e Signed-off-by: Olivier Dony (odo) Signed-off-by: Xavier Morel (xmo) --- odoo/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/http.py b/odoo/http.py index 4d2df076032..1a494be1fa3 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1071,7 +1071,7 @@ class OpenERPSession(sessions.Session): if lang in babel.core.LOCALE_ALIASES: lang = babel.core.LOCALE_ALIASES[lang] - context['lang'] = lang + context['lang'] = lang or 'en_US' def save_action(self, action): """