Odoo Help


How to send data to generate a report?

Juan Formoso
on 7/9/14, 5:04 AM 660 views

I am trying to generate a report, the only thing I know about the following code is that the function which calls the "report generator" has to return the type 'ir.actions.report.xml'. Then, I tried to change the value of report_name, which I thought it was possible, but it gives me an error if I change its name. And I do not have any idea of which content has to have the dictionary datas, the only variable I see that is repeating in every code I check is model.

Anyone could explain me this a bit to understand it better or recommend me a tutorial (not the official one)?. I am a newbie on this, I would appreciate any help.

def check_report(self, cr, uid, ids, context=None):
    if context is None:
        context = {}
    data = self.read(cr, uid, ids)[0]
    datas = {
        'ids': context.get('active_ids', []),
        'model': 'account.analytic.account',
        'form': data
    return {
        'type': 'ir.actions.report.xml',
        'report_name': 'account.analytic.account.balance',
        'datas': datas,

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/9/14, 5:04 AM
Seen: 660 times
Last updated: 3/16/15, 8:10 AM