Browse Source

[9.0][FIX][report_custom_filename] API migration (#92)

pull/93/head
Pedro Castro Silva 8 years ago
committed by Pedro M. Baeza
parent
commit
98f8b336f7
  1. 10
      report_custom_filename/controllers/reports.py

10
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\

Loading…
Cancel
Save