[FIX] ir_translation: prevent `overwrite` propagation
Once set for the loading of terms for a lang, the flag `overwrite` was propagated to all other following languages, even if not actually needed. Use case: - Installed languages: en_US, de, fr_CH, it - Update of the `sale` module - In `load_module_terms`, the system iterates through the languages: 1. en_US: No problem 2. de: No problem 3. fr_CH: The flag `overwrite` is set to `True`, because the sub-language `fr_CH` should overwrite the `fr` terms 4. it: The flag is still set to `True`, because of the previous iteration, while it must not. opw-654042
This commit is contained in:
parent
22d0592c9a
commit
ff2910f8f2
|
@ -468,12 +468,13 @@ class ir_translation(osv.osv):
|
||||||
return ir_translation_import_cursor(cr, uid, self, context=context)
|
return ir_translation_import_cursor(cr, uid, self, context=context)
|
||||||
|
|
||||||
def load_module_terms(self, cr, modules, langs, context=None):
|
def load_module_terms(self, cr, modules, langs, context=None):
|
||||||
context = dict(context or {}) # local copy
|
context_template = dict(context or {}) # local copy
|
||||||
for module_name in modules:
|
for module_name in modules:
|
||||||
modpath = openerp.modules.get_module_path(module_name)
|
modpath = openerp.modules.get_module_path(module_name)
|
||||||
if not modpath:
|
if not modpath:
|
||||||
continue
|
continue
|
||||||
for lang in langs:
|
for lang in langs:
|
||||||
|
context = dict(context_template)
|
||||||
lang_code = tools.get_iso_codes(lang)
|
lang_code = tools.get_iso_codes(lang)
|
||||||
base_lang_code = None
|
base_lang_code = None
|
||||||
if '_' in lang_code:
|
if '_' in lang_code:
|
||||||
|
|
Loading…
Reference in New Issue