Skip to Content
Menú
This question has been flagged
2 Respostes
1367 Vistes

Hello, I’m fairly new to using Odoo and I have a question.

I am using the Odoo service to have the server in order to create invoices, and I am currently using it via the API.

My question is about how the body of my request should look in order to generate a link (or something) to download the PDF of an invoice?

I have this: 

Endpoint: [domain].odoo.com/web/dataset/call_kw

Body: 
{

    "jsonrpc": "2.0",

    "method": "call",

    "params": {

        "model": "account.move",

        "method": "print_document",

        "args": [6], 

        "kwargs": {}

    },

    "id": 1

}


Error:  The method 'print_document' does not exist on the model 'account.move'

Thank you very much

Avatar
Descartar
Autor Best Answer

Hello André, thank you for your response. It turns out that I don’t have Odoo installed on an external server, but on Odoo’s hosting, so I believe I can’t create a new method (or can I?). Could you please give me some guidance on how to grant permissions to my user? I have changed the body of my request, and it shows an error stating that the method I am trying to use is private.

Thank you.

Avatar
Descartar
Best Answer

Have a look at how to use the API. The documentation helps a little bit.
Pay attention to the version of your Odoo instance.

The most important thing regarding API calls is to understand the Odoo object structure, and how you can call actions, depending on the model, and fields of the record. 

The second part is regarding permissions. 
Your user must have permission to call the objects, or you must set a workaround on the server side,(create a new method or cal)l, that lets you access the information you want to access from the API. 

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
d’ag. 25
415
2
de jul. 25
2840
3
de jul. 25
647
1
de juny 25
2114
1
d’ag. 25
1019