Skip to content

Commit

Permalink
[REV] Revert c43647f: "[FIX] odoo: Traceback when creating a new cont…
Browse files Browse the repository at this point in the history
…act"

This reverts commit c43647f.

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 odoo#52758

closes odoo#53254

Signed-off-by: Olivier Dony (odo) <[email protected]>
  • Loading branch information
odony committed Jun 18, 2020
1 parent 1a885ff commit e220c5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odoo/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ def _fix_lang(self, context):
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):
"""
Expand Down

0 comments on commit e220c5a

Please sign in to comment.