Hello,
I am trying to generate my first report. I was able to do it and it generates the right PDF when I insert no dynamic content, but as soon as I insert a loop with a field and I try to open the PDF I get a "File is damaged" error.
My report is intended to be printed from a wizard, here is part of the code
def print_report(self,cr,uid,ids,context=None):
if context is None:
context = {}
datas = {'ids': context.get('active_ids', [])}
print datas
res = self.read(cr, uid, ids, context=context)
res = res and res[0] or {}
datas['form'] = res
print res
return {
'type': 'ir.actions.report.xml',
'report_name': 'sim.prov.rndrxVtT',
'datas': datas,
}
And this is how I am calling the field in my RML file
<para style="Standard">[[ repeatIn(objects,'prov') ]][[ prov.name2 ]]</para>
If I delete that line and insert some static text it works just fine (obviously not as intended)
Any tip on how can I make my first dynamic report to work?
Thanks!
NOTE: Obviously this only happen with the reports coming from my custom module. When I try any other module reports they work fine. I really don't know what else to do
you could try: <para style="Standard">[[ repeatIn(objects,'prov') ]]</para> <para style="Standard">[[ prov.name2 ]]</para>
Thanks, unfortunately it doesn't work. I really don't know what else to do and I can't find an example module to at least make sure it works.