mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[FIX] Set back old tray behaviour to take user or report default if tray not set on action - update tests for printer tray to new determinant location
This commit is contained in:
@@ -93,7 +93,10 @@ class IrActionsReport(models.Model):
|
||||
('action', '!=', 'user_default'),
|
||||
], limit=1)
|
||||
if print_action:
|
||||
result.update(print_action.behaviour())
|
||||
# For some reason design takes report defaults over
|
||||
# False action entries so we must allow for that here
|
||||
result.update({k: v for k, v in
|
||||
print_action.behaviour().items() if v})
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
|
||||
@@ -165,9 +165,13 @@ 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:
|
||||
getattr(self, '_set_option_%s' % option)(report, value)
|
||||
options.update(getattr(
|
||||
self, '_set_option_%s' % option)(report, value))
|
||||
except AttributeError:
|
||||
options[option] = str(value)
|
||||
return options
|
||||
|
||||
Reference in New Issue
Block a user