
Odoo 14 Development Cookbook
By :

In this recipe, we will see how you can fetch the data from an Odoo instance through RPC. The user can access most data, except data that is restricted by the security access control and record rules. RPC can be used in many situations, such as collecting data for analysis, manipulating a lot of data at once, or fetching data for display in another software/system. There are endless possibilities, and you can use RPCs whenever necessary.
We will create a Python program to fetch the book data from the library.book
model. Make sure you have installed the my_library
module and that the server is running on http://localhost:8069
.
Perform the following steps to fetch a book's information through RPC:
books_data.py
file. You can place this file anywhere you want because the RPC program will work independently.from xmlrpc import client server_url...