From 521a3eb4b07ca361c69f28a4cfdf80e7c0bb0c19 Mon Sep 17 00:00:00 2001 From: czoellner Date: Sun, 25 Oct 2015 12:14:52 +0100 Subject: [PATCH] pass context to printer to use it for example in print_options() * context was lost while getting report * now it will be passed using with_context * could be used for print_options (example: pass copies amount for productlabals) --- base_report_to_printer/report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base_report_to_printer/report.py b/base_report_to_printer/report.py index 4986d15..d63c388 100644 --- a/base_report_to_printer/report.py +++ b/base_report_to_printer/report.py @@ -42,7 +42,8 @@ class Report(models.Model): raise exceptions.Warning( _('No printer configured to print this report.') ) - return printer.print_document(report, document, report.report_type) + return printer.with_context(context).print_document( + report, document, report.report_type) @api.v8 def print_document(self, records, report_name, html=None, data=None):