Skip to Content
Menu
This question has been flagged
2 Replies
1257 Views

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
Discard
Author 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
Discard
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
Discard
Related Posts Replies Views Activity
0
Jul 25
123
1
Jun 25
1852
1
Jul 25
837
1
Apr 25
1520
1
Feb 25
960