Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
1281 Tampilan

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
Buang
Penulis Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jul 25
27
2
Jul 25
362
1
Jun 25
1914
1
Jul 25
899
1
Apr 25
1556