Odoo Help


File corrupted when generating report

on 7/1/13, 4:23 PM 1,444 views


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?


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>

on 7/3/13, 12:42 PM

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.

on 7/3/13, 2:07 PM

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/1/13, 4:23 PM
Seen: 1444 times
Last updated: 3/16/15, 8:10 AM