Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Odoo 9 Qweb-html from wizard

By
Marios Kleanthous
on 10/17/16, 10:01 AM 246 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,}

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/17/16, 10:01 AM
Seen: 246 times
Last updated: 10/17/16, 10:26 AM