From ff2910f8f247225dbd882190d5ac2dc706e5ac85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Garbely?= Date: Wed, 9 Dec 2015 17:15:43 +0100 Subject: [PATCH] [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 --- openerp/addons/base/ir/ir_translation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_translation.py b/openerp/addons/base/ir/ir_translation.py index da3a3556a5f..6e2dc73b019 100644 --- a/openerp/addons/base/ir/ir_translation.py +++ b/openerp/addons/base/ir/ir_translation.py @@ -468,12 +468,13 @@ class ir_translation(osv.osv): return ir_translation_import_cursor(cr, uid, self, context=context) 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: modpath = openerp.modules.get_module_path(module_name) if not modpath: continue for lang in langs: + context = dict(context_template) lang_code = tools.get_iso_codes(lang) base_lang_code = None if '_' in lang_code: