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 send data to generate a report?

By
Juan Formoso
on 7/9/14, 5:04 AM 403 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,
    }

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: 7/9/14, 5:04 AM
Seen: 403 times
Last updated: 3/16/15, 8:10 AM