Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
4806 Visualizações

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
Cancelar
Autor Melhor resposta

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
Cancelar

Thanks alot... Works perfectly

Publicações relacionadas Respostas Visualizações Atividade
1
abr. 23
1758
1
mar. 22
3451
PDF reports Resolvido
5
jul. 25
2164
2
mar. 24
2701
0
nov. 22
2909