mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Add support for multiple copies
This commit is contained in:
committed by
John Herholz
parent
227998c87f
commit
95e7f39d41
@@ -23,7 +23,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
{
|
{
|
||||||
'name': "Report to printer",
|
'name': "Report to printer",
|
||||||
'version': '8.0.0.1.1',
|
'version': '8.0.0.1.2',
|
||||||
'category': 'Generic Modules/Base',
|
'category': 'Generic Modules/Base',
|
||||||
'author': "Agile Business Group & Domsense, Pegueroles SCP, NaN,"
|
'author': "Agile Business Group & Domsense, Pegueroles SCP, NaN,"
|
||||||
"Odoo Community Association (OCA)",
|
"Odoo Community Association (OCA)",
|
||||||
|
|||||||
@@ -108,15 +108,17 @@ class PrintingPrinter(models.Model):
|
|||||||
self.write(vals)
|
self.write(vals)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def print_options(self, report, format):
|
def print_options(self, report, format, copies=1):
|
||||||
""" Hook to set print options """
|
""" Hook to set print options """
|
||||||
options = {}
|
options = {}
|
||||||
if format == 'raw':
|
if format == 'raw':
|
||||||
options['raw'] = 'True'
|
options['raw'] = 'True'
|
||||||
|
if copies > 1:
|
||||||
|
options['copies'] = str(copies)
|
||||||
return options
|
return options
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def print_document(self, report, content, format):
|
def print_document(self, report, content, format, copies=1):
|
||||||
""" Print a file
|
""" Print a file
|
||||||
|
|
||||||
Format could be pdf, qweb-pdf, raw, ...
|
Format could be pdf, qweb-pdf, raw, ...
|
||||||
@@ -142,7 +144,7 @@ class PrintingPrinter(models.Model):
|
|||||||
"you can reach it from the Odoo server.")
|
"you can reach it from the Odoo server.")
|
||||||
% (CUPS_HOST, CUPS_PORT))
|
% (CUPS_HOST, CUPS_PORT))
|
||||||
|
|
||||||
options = self.print_options(report, format)
|
options = self.print_options(report, format, copies)
|
||||||
|
|
||||||
_logger.debug(
|
_logger.debug(
|
||||||
'Sending job to CUPS printer %s on %s'
|
'Sending job to CUPS printer %s on %s'
|
||||||
|
|||||||
Reference in New Issue
Block a user