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

How to generate report(parser report) from wizard in odoo8

By
Rahul Nimgade
on 9/12/16, 2:30 AM 146 views

Hello All

Can anyone help me to reach this question, i had refered accounting module ..there is "check_report" method i have been studying it form many days but i do not getting the point how can we generate a simple report form wizard print button

can anyone help me in detail...

i have refered this link but got no solution

https://www.odoo.com/forum/help-1/question/print-value-of-a-field-in-wizard-to-report-34705

https://www.odoo.com/forum/help-1/question/how-to-generate-a-report-from-a-wizard-22334


0
james_p
On 9/13/16, 3:32 AM

You are on the right track. The check_report method in account/wizard/account_report_common.py is inside a a models.TransientModel class named account.common.report. Then it calls print_report. In the same file, this method is not defined. But if you check say account/wizard/account_report_aged_partner_balance.py, you will see that it inherits account.common.partner.report which inherits account.common.report.


Next the print_report method returns this:

self.env['report'].with_context(landscape=True).get_action(self, 'account.report_agedpartnerbalance', data=data)self.env['report'].with_context(landscape=True).get_action(self, 'account.report_agedpartnerbalance', data=data)


Then you can check account/report/account_agent_partner_balance.py which defines a models.Abstractmodel that processes the data and renders the report thru the reder_html method. The name of the Abstractmodel is important as it should be formatted like this: report.module_name.report_name, where report_name is the name of the report defined in your xml.


So, in conclusion, at the minimum, you need to define a TransientModel class then an AbstractModel class with render_html as a method.

Hope that helps.

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: 9/12/16, 2:30 AM
Seen: 146 times
Last updated: 9/13/16, 3:32 AM