Hello,
I'm developing an app which requires getting PDF of invoices from External API.
I'm able to generate a download link using account.move.action_invoice_download_pdf method, but it only works with a logged user within a web browser, if i get this url via postman, I receive the login page html.
I tried to add the bearer token in the Authorization header, it doesn't work.
So I'd like to know if there is a method which allows to directly download a report/pdf via API.
I tried acount.move.action_print_pdf, I receive
{
"jsonrpc": "2.0",
"id": null,
"result": {
"context": {
"active_ids": [
161
]
},
"data": null,
"type": "ir.actions.report",
"report_name": "account.report_invoice_with_payments",
"report_type": "qweb-pdf",
"report_file": "account.report_invoice_with_payments",
"name": "Facture PDF"
}
}
then I try ir.actions.report.report_action like this:
{
"jsonrpc": "2.0",
"method": "call",
"params": {
"service": "object",
"method": "execute",
"args": [
"{{ _.db_name }}",
2,
"{{ _.api_key }}",
"ir.actions.report",
"report_action",
[161]
, { "model": "account.move" },
"account.report_invoice_with_payments"
]
}
}
But I receive the error message: "cannot access local variable 'active_ids' where it is not associated with a value"
There is not documentation explaining how to do that, I'm reading the GitHub but still didn't find any solution...
Bonjour,
Merci pour votre message.
Je suis actuellement absent et prendrai connaissance de votre mail à mon retour, le 8 mai 2025.
En cas d’urgence, vous pouvez contacter le support :
<![if !supportLists]>·<![endif]>par téléphone au 071/36.60.62
<![if !supportLists]>·<![endif]>par mail à l'adresse suivante : support@mhc.be
Merci de votre compréhension.
Bien à vous.
Julien Durieux - MHCONSULTANTS