Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Odoo/OpenERP library for RPC

Project Description


This is core part of OpenERP Proxy

This project is just RPC client for Odoo. This project provides interface similar to Odoo internal code to perform operations on OpenERP / Odoo objects hiding XML-RPC or JSON-RPC behind.

*Note*: documentation now is “Work in Progress” state, so here is documentation from openerp_proxy project. In most cases it is compatible, except extensions, which are not part of this project. Thats why there are a lot of links to openerp_proxy documentation.


  • Python 3.3+ support
  • You can call any public method on any OpenERP / Odoo object including: read, search, write, unlink and others
  • Have a lot of speed optimizations (caching, read only requested fields, read data for all records in current set (cache), by one RPC call, etc)
  • Desinged to take as more benefits of IPython autocomplete as posible
  • Provides browse_record like interface, allowing to browse related models too. Supports browse method. Also adds method search_records to simplify search-and-read operations.
  • Extension support. You can easily modify most of components of this app/lib creating Your own extensions and plugins. It is realy simple. See for examples in openerp_proxy/ext/ directory.
  • Plugin Support. Plugins are same as extensions, but aimed to implement additional logic. For example look at odoo_rpc_client/plugins and odoo_rpc_client/
  • Support of JSON-RPC for version 8+ of Odoo
  • Support of using named parametrs in RPC method calls (server version 6.1 and higher).
  • Experimental integration with AnyField
  • Missed feature? ask in Project Issues

Quick example

from odoo_rpc_client import Client

client = Client('localhost', 'my_db', 'user', 'password')

# get current user

# simple rpc calls
client.execute('res.partner', 'read', [])

# Model browsing
SaleOrder = client['sale.order']
s_orders = SaleOrder.search_records([])
for order in s_orders:
    for line in order.order_line:
        print("\t%s" %
    print("-" * 5)

Supported Odoo server versions

Tested with: - Odoo versions: 7.0, 8.0, 9.0, 10.0, 11.0 - Python versions: 2.7, 3.3, 3.4, 3.5, 3.6


This project is present on PyPI so it could be installed via PIP:

pip install odoo_rpc_client


Connect to server / database

The one diference betwen using as lib and using as shell is the way connection to database is created. When using as shell the primary object is session, which provides some interactivity. But when using as library in most cases there are no need for that interactivity, so connection should be created manualy, providing connection data from some other sources like config file or something else.

So here is a way to create connection

from odoo_rpc_client import Client
db = Client(host='',
            pwd='my_password here')

And next all there same, no more differences betwen shell and lib usage.

General usage

For example lets try to find how many sale orders in ‘done’ state we have in our database. (Look above sections to get help on how to connect to Odoo database)

>>> sale_order_obj = db['sale.order']  # or You may use 'db.get_obj('sale.order')' if You like
>>> # Now lets search for sale orders:
>>>[('state', '=', 'done')], count=True)

So we have 5 orders in done state. So let’s read them.

Default way to read data from Odoo is to search for required records with search method which return’s list of IDs of records, then read data using read method. Both methods mostly same as Odoo internal ones:

>>> sale_order_ids =[('state', '=', 'done')])
>>> sale_order_datas =, ['name'])  # Last argument is optional.
                                                                      # it describes list of fields to read
                                                                      # if it is not provided then all fields
                                                                      # will be read
>>> sale_order_datas[0]
{'id': 3,
 'name': 'SO0004'

As we see reading data in such way allows us to get list of dictionaries where each contain fields have been read

Another way to read data is to use search_records or read_lecords method. Each of these methods receives same aguments as search or read method respectively. But passing count argument for search\_records will cause error. Main difference betwen these methods in using Record class instead of dict for each record had been read. Record class provides some orm-like abilities for records, allowing for example access fields as attributes and provide mechanisms to lazily fetch related fields.

>>> sale_orders = sale_order_obj.search_records([('state', '=', 'done')])
>>> sale_orders[0]
R(sale.order, 9)[SO0011]
>>> # So we have list of Record objects. Let's check what they are
>>> so = sale_orders[0]
>>> so.partner_id
R(res.partner, 9)[Better Corp]
Better Corp

Additional features


In version 0.4 plugin system was completly refactored. At this version we start using extend_me library to build extensions and plugins easily.

Plugins are usual classes that provides functionality that should be available at db.plugins.* point, implementing logic not related to core system.

For more information see source code

Documentation for this project, is in “Work in progress state”, so look for openerp_proxy documentation, In basic things this project is compatible. For more compatability info look in CHANGELOG

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(66.5 kB) Copy SHA256 Hash SHA256
Wheel 3.6 Oct 28, 2017
(70.8 kB) Copy SHA256 Hash SHA256
Source None Oct 28, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting