Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
5096 Vistas

Hello, I have some report made in other module for sale.order model.

That report usually I attached it to an email template, but I want reused it in other module to put as message log on the sale orders view. I just need get the pdf but I can not found good example(in old API) to do something that simple.

I have seen some examples in the new API:

report_name = 'external_id_of_your_report'
datas=self.env['report'].get_pdf(self, report_name)

 And I try this:

pdf = self.pool.get('report').get_pdf(cr, uid, sale_order_idreport_name)

But return me "error index out of range".

Help.



Avatar
Descartar
Mejor respuesta

Hello,

Please refer below link will help you

https://www.odoo.com/forum/help-1/question/programatically-print-a-report-and-save-it-to-disk-on-server-97624

Avatar
Descartar
Autor

I made 2 mistakes

- sale_order_id must be inside an array: [sale_order_id]

- I try to use report.name like report.report_name

Ty for your help :)

Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 15
4821
1
jul 24
9084
0
ene 16
3403
PDF reports Resuelto
5
jul 25
2194
2
mar 24
2721