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,
}