Merge pull request #160 from CompassionCH/10.0

[FIX] printer_tray: print_options expecting the full report instead of a string
This commit is contained in:
Pedro M. Baeza
2018-09-04 13:11:57 +02:00
committed by GitHub

View File

@@ -76,16 +76,18 @@ class PrintingPrinter(models.Model):
options = super(PrintingPrinter, self).print_options(report, format)
if report is not None:
full_report = self.env['report']._get_report_from_name(report) \
if isinstance(report, basestring) else report
# Retrieve report default values
if report.printer_tray_id:
tray = report.printer_tray_id
if full_report.printer_tray_id:
tray = full_report.printer_tray_id
else:
# Retrieve user default values
tray = self.env.user.printer_tray_id
# Retrieve report-user specific values
action = printing_act_obj.search([
('report_id', '=', report.id),
('report_id', '=', full_report.id),
('user_id', '=', self.env.uid),
('action', '!=', 'user_default'),
], limit=1)