Skip to Content
Menu
This question has been flagged
3309 Views

Hello all,

I have a report that shows all the projects. On top of that I have created a wizard that allow the user to filter the results and call the previous report with only the select data to be shown.

The report by itself works just fine showing all the reports in html and the wizard works also if I request the report in pdf

The problem is that if I call the report from the wizard using the 'report_type': 'qweb-html' option the selected data (selections/filtering made by the user) are not passed to the render_html function. Just to add one more hint, if I use 'report_type': 'qweb-pdf' I have the exact same problem, and that's why I use 'report_type': 'pdf' to print the report in pdf. It seems that whenever I use qweb-html or qweb-pdf as a report type the controller doesn't send the wizard form data to the render_html.

Can you please help me with this issue? Below is my wizard code that calls the report to give you an idea. pdfPrint variable is based on which button you press on the wizard (Show in html->pdfPrint=0, Show in PDF->pdfPrint=1).

Part of Wizard Class:

datas = { 'ids' : res,
'model' : 'project.reportwizard',
'form' : self.read(cr, uid, ids, context=context)[0],
'context' : context,}
reportType = 'qweb-html'
pdfPrint = context.get('pdfPrint',1)
if pdfPrint:
    reportType = 'pdf'
return { 'type' : 'ir.actions.report.xml',
'report_name' : 'project.report_project_summary',
'report_type': reportType,
'datas' : datas,}
Avatar
Discard