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
|
||||
def print_options(self, report=None, **print_opts):
|
||||
options = {}
|
||||
if not report:
|
||||
return options
|
||||
|
||||
for option, value in print_opts.items():
|
||||
try:
|
||||
options.update(getattr(
|
||||
|
||||
@@ -71,7 +71,7 @@ class TestPrintingPrinter(TransactionCase):
|
||||
# with tests in test_printing_printer_tray from when modules merged
|
||||
report = self.env['ir.actions.report'].search([], limit=1)
|
||||
self.assertEqual(self.Model.print_options(
|
||||
report, doc_format='raw'), {'raw': 'True'}
|
||||
doc_format='raw'), {'raw': 'True'}
|
||||
)
|
||||
self.assertEqual(self.Model.print_options(
|
||||
report, doc_format='pdf', copies=2), {'copies': '2'}
|
||||
|
||||
Reference in New Issue
Block a user