[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) <odo@openerp.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
Olivier Dony
2020-06-18 17:06:08 +00:00
parent 9ae5b5a0ab
commit 80379606db
+1 -1
View File
@@ -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):
"""