diff --git a/base_report_to_printer/__openerp__.py b/base_report_to_printer/__openerp__.py index b6c8f49..9259a54 100644 --- a/base_report_to_printer/__openerp__.py +++ b/base_report_to_printer/__openerp__.py @@ -23,7 +23,7 @@ ############################################################################## { 'name': "Report to printer", - 'version': '8.0.0.1.1', + 'version': '8.0.0.1.2', 'category': 'Generic Modules/Base', 'author': "Agile Business Group & Domsense, Pegueroles SCP, NaN," "Odoo Community Association (OCA)", diff --git a/base_report_to_printer/printing.py b/base_report_to_printer/printing.py index 742859b..129fc62 100644 --- a/base_report_to_printer/printing.py +++ b/base_report_to_printer/printing.py @@ -108,15 +108,17 @@ class PrintingPrinter(models.Model): self.write(vals) @api.multi - def print_options(self, report, format): + def print_options(self, report, format, copies=1): """ Hook to set print options """ options = {} if format == 'raw': options['raw'] = 'True' + if copies > 1: + options['copies'] = str(copies) return options @api.multi - def print_document(self, report, content, format): + def print_document(self, report, content, format, copies=1): """ Print a file Format could be pdf, qweb-pdf, raw, ... @@ -142,7 +144,7 @@ class PrintingPrinter(models.Model): "you can reach it from the Odoo server.") % (CUPS_HOST, CUPS_PORT)) - options = self.print_options(report, format) + options = self.print_options(report, format, copies) _logger.debug( 'Sending job to CUPS printer %s on %s'