mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Fix set the skip directive in context
instead of a faulty return
This commit is contained in:
committed by
Rod Schouteden
parent
dc26912a7b
commit
0a62d01403
@@ -43,8 +43,12 @@ class Report(models.Model):
|
||||
def print_document(self, cr, uid, ids, report_name, html=None,
|
||||
data=None, context=None):
|
||||
""" Print a document, do not return the document file """
|
||||
if context is None:
|
||||
context = self.pool['res.users'].context_get(cr, uid)
|
||||
local_context = dict(context)
|
||||
local_context['must_skip_sent_to_printer'] = True
|
||||
document = self.get_pdf(cr, uid, ids, report_name,
|
||||
html=html, data=data, context=context)
|
||||
html=html, data=data, context=local_context)
|
||||
report = self._get_report_from_name(cr, uid, report_name)
|
||||
behaviour = report.behaviour()[report.id]
|
||||
printer = behaviour['printer']
|
||||
@@ -73,7 +77,6 @@ class Report(models.Model):
|
||||
behaviour, printer, document,
|
||||
context=context)
|
||||
if can_send_report:
|
||||
sent = printer.print_document(report, document, report.report_type)
|
||||
printer.print_document(report, document, report.report_type)
|
||||
context['must_skip_sent_to_printer'] = True
|
||||
return sent
|
||||
return document
|
||||
|
||||
Reference in New Issue
Block a user