[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
This commit is contained in:
Christophe Matthieu 2013-07-08 12:54:25 +02:00
parent 67446c03c8
commit e4aad29beb
1 changed files with 3 additions and 1 deletions

View File

@ -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,