Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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
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.
About This Community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/12/16, 2:30 AM|
|Seen: 394 times|
|Last updated: 9/13/16, 3:32 AM|