Skip to Content
Menu
This question has been flagged
1 Reply
3486 Views

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!

Avatar
Discard
Author Best Answer

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



Avatar
Discard

Thanks alot... Works perfectly

Related Posts Replies Views Activity
1
Apr 23
926
1
Mar 22
2233
4
Jun 24
604
2
Mar 24
777
0
Nov 22
1548