跳至内容
菜单
此问题已终结
1 回复
4676 查看

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.



形象
丢弃
最佳答案

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

形象
丢弃
编写者

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 :)

相关帖文 回复 查看 活动
1
7月 15
4449
1
7月 24
8562
0
1月 16
2985
4
6月 24
1391
2
3月 24
1810