OERPLib is a client library to OpenERP server. It aims to provide an easy way to remotely pilot an OpenERP server.
How does it work? See below:
#!/usr/bin/env python
import oerplib
# Prepare the connection to the OpenERP server
oerp = oerplib.OERP('localhost', 'db_name')
# Login (the object returned is a browsable record)
user = oerp.login('user', 'passwd')
print(user.name) # name of the user connected
print(user.company_id.name) # the name of its company
# Simple 'raw' query
user_data = oerp.execute('res.users', 'read', user.id)
print(user_data)
# Or use the 'read' method
# ('create', 'write', 'unlink' and 'search' exist too)
user_data = oerp.read('res.users', user.id)
# Advanced query: get browsable records
for order in oerp.browse('sale.order', [1, 2]):
print(order.name)
for line in order.order_line:
print(line.name)
# Update data through a browsable record
user.name = "Brian Jones"
oerp.write_record(user)
See Download and install instructions section.
OERPLib is known to work with OpenERP server v5 and v6.
OERPLib support Python versions 2.6 and 2.7.
This software is made available under the LGPLv3 license.
Please, feel free to report bugs or suggestions in the Bug Tracker!