mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[FIX] Allow to generate printing options without a report
This commit is contained in:
@@ -156,9 +156,6 @@ class PrintingPrinter(models.Model):
|
|||||||
@api.multi
|
@api.multi
|
||||||
def print_options(self, report=None, **print_opts):
|
def print_options(self, report=None, **print_opts):
|
||||||
options = {}
|
options = {}
|
||||||
if not report:
|
|
||||||
return options
|
|
||||||
|
|
||||||
for option, value in print_opts.items():
|
for option, value in print_opts.items():
|
||||||
try:
|
try:
|
||||||
options.update(getattr(
|
options.update(getattr(
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class TestPrintingPrinter(TransactionCase):
|
|||||||
# with tests in test_printing_printer_tray from when modules merged
|
# with tests in test_printing_printer_tray from when modules merged
|
||||||
report = self.env['ir.actions.report'].search([], limit=1)
|
report = self.env['ir.actions.report'].search([], limit=1)
|
||||||
self.assertEqual(self.Model.print_options(
|
self.assertEqual(self.Model.print_options(
|
||||||
report, doc_format='raw'), {'raw': 'True'}
|
doc_format='raw'), {'raw': 'True'}
|
||||||
)
|
)
|
||||||
self.assertEqual(self.Model.print_options(
|
self.assertEqual(self.Model.print_options(
|
||||||
report, doc_format='pdf', copies=2), {'copies': '2'}
|
report, doc_format='pdf', copies=2), {'copies': '2'}
|
||||||
|
|||||||
Reference in New Issue
Block a user