This question has been flagged
1 Reply
5109 Views

Odoo 11

How to create a vendor invoice through a purchase order using XML-RPC or odooRPC?

In the same way you can validate the invoice: ..... execute_kw ('purchase.order', 'button_confirm', [purchase.order.id])

....execute_kw ('account.invoice', '???????', [purchase.order.id]).

Avatar
Discard

Hello,

the 'action_invoice_create' method only exists in 'sale.order', I did not find a similar method in 'purcase.order' or 'account.invoice'.

Do you have any tip ?

There is a CREATE method for every model in Odoo. Use that to create/import orders, bills, invoices, etc. See https://www.odoo.com/documentation/12.0/webservices/odoo.html for code samples.

Best Answer

As in https://www.odoo.com/documentation/12.0/webservices/odoo.html

models.execute_kw(DB_NAME, uid, PASSWORD,
                             'sale.order', 'action_invoice_create', [sale.order.id])

example:

models.execute_kw('DB_NAME', 'uid', 'PASSWORD',
                             'sale.order', 'action_invoice_create', [11])

It will create invoice draft.

Avatar
Discard