[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 57bd6a112e
commit 0d0acbc096
5 changed files with 118 additions and 74 deletions

View File

@@ -157,9 +157,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