From 962d0ee354db28533252d04e74ec46d01e2a2db8 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 29 Jul 2016 11:40:14 +0200 Subject: [PATCH] [FIX] report: display correclty the first printed report The key 'commit_assetsbundle' wasn't in the context to the method 'get_pdf' This issue comes from the module migration. --- addons/report/models/report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/report/models/report.py b/addons/report/models/report.py index c66afb6f863..398bb7beade 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -162,7 +162,7 @@ class Report(models.Model): context['debug'] = False if html is None: - html = self.get_html(docids, report_name, data=data) + html = self.with_context(context).get_html(docids, report_name, data=data) # The test cursor prevents the use of another environnment while the current # transaction is not finished, leading to a deadlock when the report requests @@ -191,7 +191,7 @@ class Report(models.Model): # Minimal page renderer view_obj = self.env['ir.ui.view'] - render_minimal = partial(view_obj.render_template, 'report.minimal_layout') + render_minimal = partial(view_obj.with_context(context).render_template, 'report.minimal_layout') # The received html report must be simplified. We convert it in a xml tree # in order to extract headers, bodies and footers.