From 22606c89057cb70ecf8f379144092319bc7275e2 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 24 Feb 2015 17:33:35 +0100 Subject: [PATCH] [FIX] report: abstract reports default lang In ir_ui_view.py, in method render (line 132 atm), the values passed to the rendering engine is a merge of the context and the values. Therefore, if at this place, the language is rightly set in the context, the report lang will be as well in the values. In abstract_report.py, the values passed to the render method is the wrapped report localcontext in which are added some key/values (docs, doc_ids, doc_model). By default, the lang in the localcontext is False See __init__ method of rml_parse class in report_sxw.py. If setLang method is not called, the lang in the localcontext remains False. In this rev., we avoid to overwrite the lang from the context by the lang of the localcontext if this one is False, so the lang of the report is set with the current context lang. Forcing the lang of the report to False had as side-effect to prevent the editing of report using the website editor(e.g. playslip_report) opw-628720 --- addons/report/models/abstract_report.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/report/models/abstract_report.py b/addons/report/models/abstract_report.py index 08d70e83e20..cccaa339b63 100644 --- a/addons/report/models/abstract_report.py +++ b/addons/report/models/abstract_report.py @@ -54,7 +54,9 @@ class AbstractReport(osv.AbstractModel): # Rendering self._template with the wrapped report instance localcontext as # rendering environment - docargs = wrapped_report.localcontext + docargs = dict(wrapped_report.localcontext) + if not docargs.get('lang'): + docargs.pop('lang', False) docargs['docs'] = docargs.get('objects') # Used in template translation (see translate_doc method from report model)