From ab8fe22b470243be01937d7bfb60568fdb4315e9 Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Thu, 21 May 2015 10:12:16 +0200 Subject: [PATCH] [FIX] base_report_to_printer: make print_document callable from 8.0 api --- base_report_to_printer/report.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base_report_to_printer/report.py b/base_report_to_printer/report.py index 4f1a1a9..a85c7f5 100644 --- a/base_report_to_printer/report.py +++ b/base_report_to_printer/report.py @@ -25,6 +25,7 @@ from openerp import models, exceptions, _, api class Report(models.Model): _inherit = 'report' + @api.v7 def print_document(self, cr, uid, ids, report_name, html=None, data=None, context=None): """ Print a document, do not return the document file """ @@ -43,6 +44,12 @@ class Report(models.Model): ) return printer.print_document(report, document, report.report_type) + @api.v8 + def print_document(self, records, report_name, html=None, data=None): + return self._model.print_document(self._cr, self._uid, + records.ids, report_name, + html=html, data=data, context=self._context) + def _can_print_report(self, cr, uid, ids, behaviour, printer, document, context=None): """Predicate that decide if report can be sent to printer