Install & Compatibility
Where this runs
tested against v0.10.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.134s · 18.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.126s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ODOO
✓ from odoorpc import ODOO
✗ from odoorpc import OdooRPC
Class is named ODOO (all caps) not OdooRPC
login method
✓ odoo.login('db', 'user', 'pass')
✗ odoo.authenticate('db', 'user', 'pass')
Method is .login(), not .authenticate()
Connect to an Odoo server, authenticate, access environment, and perform basic operations.
from odoorpc import ODOO
odoo = ODOO('localhost', port=8069, protocol='jsonrpc')
odoo.login('database_name', 'user', 'password')
user = odoo.env.user
print(user.name)
# Search records
partners = odoo.env['res.partner'].search([('is_company', '=', True)])
print(partners)
Errors
Common errors & fixes
ImportError: cannot import name 'OdooRPC' from 'odoorpc'
Using incorrect import name; class is ODOO (all caps).
fixReplace 'from odoorpc import OdooRPC' with 'from odoorpc import ODOO'.
AttributeError: 'ODOO' object has no attribute 'authenticate'
Method name is .login(), not .authenticate().
fixUse .login(database, username, password) instead of .authenticate().
xmlrpc.client.Fault: <Fault -2: 'Wrong server block size'>
Using deprecated XML-RPC protocol with Odoo 12+; JSON-RPC is recommended.
fixSpecify protocol='jsonrpc' when creating ODOO object.
Upgrade
Version history
0.10.1latest on PyPI · released Aug 16, 2023
Audit
Dependencies
suds-communityrequiredHandles XML-RPC communication when using XML-RPC protocol (default)