From e4aad29beb5002e5aae8defcfdc640be3c8c8859 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 8 Jul 2013 12:54:25 +0200 Subject: [PATCH] [FIX] web report: use get to find active_ids inside the context. Check if report_ids is defined bzr revid: chm@openerp.com-20130708105425-p8279f00xa7925xh --- addons/web/controllers/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 5641d991397..846b9099555 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1676,13 +1676,15 @@ class Reports(http.Controller): context.update(action["context"]) report_data = {} - report_ids = context["active_ids"] + report_ids = context.get("active_ids", None) if 'report_type' in action: report_data['report_type'] = action['report_type'] if 'datas' in action: if 'ids' in action['datas']: report_ids = action['datas'].pop('ids') report_data.update(action['datas']) + if not report_ids: + raise ValueError("action['datas']['ids'] and context['active_ids'] are undefined") report_id = report_srv.report( request.session._db, request.session._uid, request.session._password,