[FIX] base_report_to_printer: make get_pdf callable from 8.0 api

This commit is contained in:
Anthony Muschang
2015-05-20 01:08:46 +02:00
parent 6deacbe044
commit 43f3ba36f5

View File

@@ -19,7 +19,7 @@
# #
############################################################################## ##############################################################################
from openerp import models, exceptions, _ from openerp import models, exceptions, _, api
class Report(models.Model): class Report(models.Model):
@@ -56,6 +56,7 @@ class Report(models.Model):
return True return True
return False return False
@api.v7
def get_pdf(self, cr, uid, ids, report_name, html=None, def get_pdf(self, cr, uid, ids, report_name, html=None,
data=None, context=None): data=None, context=None):
""" Generate a PDF and returns it. """ Generate a PDF and returns it.
@@ -75,3 +76,9 @@ class Report(models.Model):
if can_print_report: if can_print_report:
printer.print_document(report, document, report.report_type) printer.print_document(report, document, report.report_type)
return document return document
@api.v8
def get_pdf(self, records, report_name, html=None, data=None):
return self._model.get_pdf(self._cr, self._uid,
records.ids, report_name,
html=html, data=data, context=self._context)