[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:
Graeme Gellatly
2017-10-08 21:02:25 +13:00
parent a051a146d7
commit 8220b750b5
5 changed files with 118 additions and 74 deletions

View File

@@ -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

View File

@@ -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