From 22e80aff7dabff85abe98b8345135b01b1f82b0e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 2 Jun 2016 20:47:45 +0200 Subject: [PATCH] Use action['datas']['ids'] and fallback on context['active_ids'] --- report_custom_filename/controllers/reports.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/report_custom_filename/controllers/reports.py b/report_custom_filename/controllers/reports.py index 8fd349bc..98f84605 100644 --- a/report_custom_filename/controllers/reports.py +++ b/report_custom_filename/controllers/reports.py @@ -45,9 +45,10 @@ class Reports(main.Reports): # context['active_ids'] has the ID of the sale order # cf https://github.com/OCA/reporting-engine/issues/56 # That's why we use report.model instead of context['active_model'] - # together with context['active_ids'] + # together with action['datas']['ids'] or context['active_ids'] objects = http.request.session.model(report.model)\ - .browse(context['active_ids']) + .browse(action.get('datas', {}).get( + 'ids', context['active_ids'])) generated_filename = email_template.mako_template_env\ .from_string(report.download_filename)\ .render({