Skip to Content
Menú
This question has been flagged
1 Respondre
4677 Vistes

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
Descartar
Autor 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
Descartar

Thanks alot... Works perfectly

Related Posts Respostes Vistes Activitat
1
d’abr. 23
1658
1
de març 22
3361
5
de jul. 25
2055
2
de març 24
2587
0
de nov. 22
2821