From 56c95d28439f0829a52ebd879719d29751a7cdbd Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 7 Apr 2015 18:33:48 +0200 Subject: [PATCH] [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*. --- openerp/report/report_sxw.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openerp/report/report_sxw.py b/openerp/report/report_sxw.py index 9f0f62b07f5..c0260656133 100644 --- a/openerp/report/report_sxw.py +++ b/openerp/report/report_sxw.py @@ -234,6 +234,7 @@ class rml_parse(object): self.localcontext['lang'] = lang self.lang_dict_called = False for obj in self.objects: + obj.refresh() obj._context['lang'] = lang def _get_lang_dict(self):