跳至內容
選單
此問題已被標幟
1 回覆
4740 瀏覽次數

I need to be able to programmatically (using python), run one of the invoice reports and save it as an attachment of some other record.

All previous versions' examples don't seem to be working now.


Anyone has a working example for this?

(a way to save the report into a pdf would suffise)

Thanks!

頭像
捨棄
作者 最佳答案

Another Odoo version, another little change in code.


# run the report and get its content

data, data_format = self.env.ref('account.account_invoices_without_payment')\                                     .sudo()._render_qweb_pdf([origin.id])



頭像
捨棄

Thanks alot... Works perfectly

相關帖文 回覆 瀏覽次數 活動
1
4月 23
1703
1
3月 22
3417
PDF reports 已解決
5
7月 25
2117
2
3月 24
2660
0
11月 22
2860