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

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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. 

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sie 25
427
2
lip 25
2850
3
lip 25
651
1
cze 25
2122
1
sie 25
1028