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

File corrupted when generating report

By
Yakito
on 7/1/13, 4:23 PM 944 views

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>

herbert6453
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.

Yakito
on 7/3/13, 2:07 PM

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