Skip to Content
Menu
This question has been flagged
1 Atsakyti
4796 Rodiniai

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!

Portretas
Atmesti
Autorius 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])



Portretas
Atmesti

Thanks alot... Works perfectly

Related Posts Replies Rodiniai Veikla
1
bal. 23
1754
1
kov. 22
3448
5
liep. 25
2162
2
kov. 24
2701
0
lapkr. 22
2907