[FIX] report_sxw: setLang() should discard browse_record cache
`setLang` alters the "browse" context of the documents being printed, but it must also discard any values already cached, as they could be using a different language. This is the case when the report uses translatable fields on `res.partner`, because `setLang` is usually called with the target partner language, hence prefetching the translatable fields with the user's language instead of the partner's language. E.g. `setLang(o.partner_id.lang)` will cache any translatable field on `o.partner_id` in the language of the *user*, not the *partner*.
This commit is contained in:
parent
ffacce7140
commit
56c95d2843
|
@ -234,6 +234,7 @@ class rml_parse(object):
|
||||||
self.localcontext['lang'] = lang
|
self.localcontext['lang'] = lang
|
||||||
self.lang_dict_called = False
|
self.lang_dict_called = False
|
||||||
for obj in self.objects:
|
for obj in self.objects:
|
||||||
|
obj.refresh()
|
||||||
obj._context['lang'] = lang
|
obj._context['lang'] = lang
|
||||||
|
|
||||||
def _get_lang_dict(self):
|
def _get_lang_dict(self):
|
||||||
|
|
Loading…
Reference in New Issue