Using the OdooRPC library
Another relevant client library to be considered is OdooRPC
. It is a complete client library that uses the JSON-RPC protocol instead of XML-RPC. The Odoo official web client uses JSON-RPC as well, although XML-RPC is still also supported.
The OdooRPC
library is now maintained under the Odoo Community Association umbrella. The source code repository can be found at https://github.com/OCA/odoorpc.
The OdooRPC
library can be installed from PyPI using the following command:
$ pip3 install odoorpc
The OdooRPC
library sets up a server connection when a new odoorpc.ODOO
object is created. At this point, we should use the ODOO.login()
method to create a user session. Just like on the server side, the session has an env
attribute containing the session's environment, including the user ID, uid
, and context
.
The OdooRPC
library can be used to provide an alternate implementation for the library_xmlrpc.py
interface with the server. It should provide...