Reader small image

You're reading from  Odoo 15 Development Essentials - Fifth Edition

Product typeBook
Published inFeb 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781800200067
Edition5th Edition
Languages
Tools
Right arrow
Author (1)
Daniel Reis
Daniel Reis
author image
Daniel Reis

Daniel Reis has a degree in applied mathematics and an MBA. He has had a long career in the IT industry, mostly as a consultant implementing business applications in a variety of sectors. He has been working with Odoo (OpenERP at the time) since 2010 and is an active contributor to the Odoo Community Association (OCA), where he also serves as a board member. He is the managing director of Open Source Integrators, a leading open source and Odoo consultancy firm.
Read more about Daniel Reis

Right arrow

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...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Odoo 15 Development Essentials - Fifth Edition
Published in: Feb 2022Publisher: PacktISBN-13: 9781800200067

Author (1)

author image
Daniel Reis

Daniel Reis has a degree in applied mathematics and an MBA. He has had a long career in the IT industry, mostly as a consultant implementing business applications in a variety of sectors. He has been working with Odoo (OpenERP at the time) since 2010 and is an active contributor to the Odoo Community Association (OCA), where he also serves as a board member. He is the managing director of Open Source Integrators, a leading open source and Odoo consultancy firm.
Read more about Daniel Reis