OdooRPC is a Python module providing an easy way to pilot your Odoo servers through RPC.
How does it work? See below:
import odoorpc
# Prepare the connection to the server
odoo = odoorpc.ODOO('localhost', port=8069)
# Check available databases
print(odoo.db.list())
# Login
odoo.login('db_name', 'user', 'passwd')
# Current user
user = odoo.env.user
print(user.name) # name of the user connected
print(user.company_id.name) # the name of its company
# Simple 'raw' query
user_data = odoo.execute('res.users', 'read', [user.id])
print(user_data)
# Use all methods of a model
Order = odoo.env['sale.order']
order_ids = Order.search([])
for order in Order.browse(order_ids):
print(order.name)
products = [line.product_id.name for line in order.order_line]
print(products)
# Update data through a record
user.name = "Brian Jones"
For more details and features, see the tutorials, the Frequently Asked Questions (FAQ) and the API reference sections.
OdooRPC has been tested on Odoo server 8.0. It should work on next versions if Odoo keeps a stable API.
OdooRPC support Python 2.7, 3.2, 3.3 and 3.4.
This software is made available under the LGPL v3 license.
Please, feel free to report bugs or suggestions in the Bug Tracker!
OdooRPC is mainly developed on free time. To show your appreciation and support this project, it is possible to make a donation through PayPal: