From 98f8b336f79f4c1439cc599a01a232b954391d4f Mon Sep 17 00:00:00 2001 From: Pedro Castro Silva Date: Sat, 7 Jan 2017 01:21:07 +0000 Subject: [PATCH] [9.0][FIX][report_custom_filename] API migration (#92) --- report_custom_filename/controllers/reports.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/report_custom_filename/controllers/reports.py b/report_custom_filename/controllers/reports.py index 5ed549af..77a830f2 100644 --- a/report_custom_filename/controllers/reports.py +++ b/report_custom_filename/controllers/reports.py @@ -16,13 +16,11 @@ class Reports(main.Reports): action = json.loads(action) context = dict(http.request.context) context.update(action["context"]) - report_xml = http.request.session.model('ir.actions.report.xml') - reports = report_xml.search( - [('report_name', '=', action['report_name'])], - 0, False, False, context) + report_xml = http.request.env['ir.actions.report.xml'] + reports = report_xml.search([ + ('report_name', '=', action['report_name']), + ('download_filename', '!=', False)]) for report in reports: - if not report.download_filename: - continue objects = http.request.session.model(context['active_model'])\ .browse(context['active_ids']) generated_filename = mail_template.mako_template_env\