[FIX] base: correctly keep report values
When rendering a report (`render_qweb_html` for example), one can pass `data` (a dict of values, used for the template rendering). This dict was overriden in `_get_rendering_context` if the method `_get_report_values` on the report model was not correctly written. This was causing an issue when rendering a report in Studio because the `studio` key was overriden. Now, the `data` dict is updated (instead of replaced) with the rendering context.
This commit is contained in:
@@ -705,12 +705,12 @@ class IrActionsReport(models.Model):
|
||||
report_model_name = 'report.%s' % self.report_name
|
||||
report_model = self.env.get(report_model_name)
|
||||
|
||||
data = data and dict(data) or {}
|
||||
|
||||
if report_model is not None:
|
||||
data = report_model._get_report_values(docids, data=data)
|
||||
data.update(report_model._get_report_values(docids, data=data))
|
||||
else:
|
||||
docs = self.env[self.model].browse(docids)
|
||||
if not data:
|
||||
data = {}
|
||||
data.update({
|
||||
'doc_ids': docids,
|
||||
'doc_model': self.model,
|
||||
|
||||
Reference in New Issue
Block a user