diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py index 5511298e746..1c909d67ed0 100644 --- a/openerp/addons/base/ir/ir_qweb.py +++ b/openerp/addons/base/ir/ir_qweb.py @@ -439,9 +439,8 @@ class QWeb(orm.AbstractModel): d = qwebcontext.copy() if 'lang' in template_attributes: - init_lang = d.context.get('lang', 'en_US') lang = template_attributes['lang'] - d.context['lang'] = self.eval(lang, d) or lang + d.context = dict(d.context, lang=self.eval(lang, d) or lang) if not self.pool['res.lang'].search(d.cr, d.uid, [('code', '=', d.context['lang'])], count=True, context=d.context): _logger.info("'%s' is not a valid language code, is an empty field or is not installed, falling back to en_US", lang) @@ -458,10 +457,6 @@ class QWeb(orm.AbstractModel): d['generated_attributes'] = generated_attributes res = self.render(cr, uid, template, d) - # we need to reset the lang after the rendering - if 'lang' in template_attributes: - d.context['lang'] = init_lang - return res def render_tag_call_assets(self, element, template_attributes, generated_attributes, qwebcontext):