Remote Procedure Calls in Odoo

The Odoo server supports Remote procedure calls (RPC), which means that you can connect Odoo instances from external applications. With the Odoo RPC API, you can perform any CRUD operations on a database. Odoo RPC is not limited to CRUD operations; you can also invoke public methods of any model. Of course, you will need to have proper access to rights to perform these operations because RPC respects all of the access rights and record rules you have defined in your database. Consequently, it is very safe to use. Odoo RPC is not platform-dependant, so you can use it on any platform, including Odoo.sh, online, or self-hosted platforms. Odoo RPC can be used with any programming language so you can integrate Odoo with any external application.

Odoo provides two types of RPC API—XML-RPC and JSON-RPC. In this recipe, we will learn how to use these RPCs from an external program. Finally, you will learn how to use Odoo RPC through OCA's odoorpc library.

In this chapter, we will cover the following recipes:

  • Logging into/connecting Odoo with XML-RPC
  • Searching/reading records through XML-RPC
  • Creating/updating/deleting records through XML-RPC
  • Calling methods through XML-RPC
  • Logging in/connecting Odoo with JSON-RPC
  • Fetching/searching records through JSON-RPC
  • Create/Update/Delete records through JSON-RPC
  • Calling methods through JSON-RPC
  • The OCA odoorpc library

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset