Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4919 Widoki

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!

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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



Awatar
Odrzuć

Thanks alot... Works perfectly

Powiązane posty Odpowiedzi Widoki Czynność
1
kwi 23
1929
1
mar 22
3625
PDF reports Rozwiązane
5
lip 25
2380
Wrong PDF Format Rozwiązane
2
mar 24
2923
0
lis 22
3071