mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[FIX] print_options expecting the full report instead of a string
This commit is contained in:
@@ -76,16 +76,18 @@ class PrintingPrinter(models.Model):
|
|||||||
options = super(PrintingPrinter, self).print_options(report, format)
|
options = super(PrintingPrinter, self).print_options(report, format)
|
||||||
|
|
||||||
if report is not None:
|
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
|
# Retrieve report default values
|
||||||
if report.printer_tray_id:
|
if full_report.printer_tray_id:
|
||||||
tray = report.printer_tray_id
|
tray = full_report.printer_tray_id
|
||||||
else:
|
else:
|
||||||
# Retrieve user default values
|
# Retrieve user default values
|
||||||
tray = self.env.user.printer_tray_id
|
tray = self.env.user.printer_tray_id
|
||||||
|
|
||||||
# Retrieve report-user specific values
|
# Retrieve report-user specific values
|
||||||
action = printing_act_obj.search([
|
action = printing_act_obj.search([
|
||||||
('report_id', '=', report.id),
|
('report_id', '=', full_report.id),
|
||||||
('user_id', '=', self.env.uid),
|
('user_id', '=', self.env.uid),
|
||||||
('action', '!=', 'user_default'),
|
('action', '!=', 'user_default'),
|
||||||
], limit=1)
|
], limit=1)
|
||||||
|
|||||||
Reference in New Issue
Block a user