The OCA odoorpc library
The Odoo Community Association (OCA) provides a Python library called odoorpc
. This is available at https://github.com/OCA/odoorpc. The odoorpc
library provides a user-friendly syntax from which to access Odoo data through RPC. It provides a similar a syntax similar to that of the server. In this recipe, we will see how you can use the odoorpc
library to perform operations through RPC.
Getting ready
The odoorpc
library is registered on the Python package (PyPI
) index. In order to use the library, you need to install it using the following command. You can use this in a separate virtual environment if you want:
pip install OdooRPC
In this recipe, we will perform some basic operations using the odoorpc
library. We will use the hostel.room
model to perform these operations. Make sure you have installed the my_hostel
module and that the server is running on http://localhost:8017
.
How to do it...
Perform the following steps to create, write, and...