Hi,
We're creating sales order via RPC API which is working fine, now I want to convert those sales order to invoices also via API.
Is this possible and if yes how can this be accomplished ?
Best Regards,
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
We're creating sales order via RPC API which is working fine, now I want to convert those sales order to invoices also via API.
Is this possible and if yes how can this be accomplished ?
Best Regards,
Yes, it is possible to convert a sales order to an invoice using the RPC API in Odoo. To do this, you can use the action_invoice_create method on the sale.order model. This method will create an invoice for the sales order and return the id of the newly created invoice. Here is an example of how you can use this method:
# Rplac `sale_order_id` with the ID of the sales order you want to convert to an invoice
sale_order = sale_order_model.browse(sale_order_id)
invoice_id = sale_order.action_invoice_create()
Once you have the id of the newly created invoice, you can use the invoice_model to retrieve the invoice and make any necessary updates or modifications.
Note that this method will only create an invoice for the sales order. It will not validate or confirm the invoice. To do that, you will need to use the invoice_model.action_invoice_open method. For more information on the available methods and fields on the sale.order and account.invoice models, you can refer to the Odoo RPC API documentation.
Configure and monitor the Odoo log file while you do anything via the User Interface to see the API methods called:
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up