diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-10-16 12:05:02 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-11-19 10:37:01 +0100 |
| commit | 49fbab5329fb95e759c3f90d4e9efb1717a9695c (patch) | |
| tree | 5ced82c181feb5f9155b27f7ac2aca7b824080c6 /odoo/addons/base/models/ir_module.py | |
| parent | 7bf6992869804973b41a785037fc176cd608320e (diff) | |
[IMP] base: split and deprecate load_lang
load_lang was a kind of hybrid method trying to active or creating a
language if not found. This was error prone.
Instead rely on two methods with clear purpose:
ResLang._create_lang(lang, lang_name=None)
- create a new res.lang entry using the locale of the server
return the res.lang record to match the API of _activate_lang
ResLang._active_lang(code)
- activate the given code lang
Most of the time, _active_lang is what is expected
tools.trans_load_data and IrTranslation._load_module_terms no longer
activate the language if not active.
Loading the translations should be explicit on an activated language,
it is too error prone to silently activate/create a language if not
found.
Remove lang_name from trans_load_data as no longer needed.
Diffstat (limited to 'odoo/addons/base/models/ir_module.py')
0 files changed, 0 insertions, 0 deletions
