A simple and clean Python connector for Odoo XML-RPC API
Project description
odoo_connector
A clean and lightweight Python connector for Odoo's XML-RPC API.
This package simplifies interactions with Odoo models using Python, so you can authenticate, read, create, update, and delete records easily.
✨ Features
- 🔐 Authentication via XML-RPC
- 📚 CRUD operations on any Odoo model
- 🔁 Generic method caller
- 🧼 Clean and well-documented code
- ✅ Ready for use in production or automation scripts
🛠️ Installation
A. Clone the repository & install locally:
git clone https://github.com/your-user/odoo_connector.git
cd odoo_connector
pip install -e .
🚀 Usage
1. Import and initialize
from odoo_connector import OdooConnector
odoo = OdooConnector(
url='https://your-odoo-instance.com',
db='your_database_name',
username='admin@example.com',
password='your_password'
)
2. Read records
partners = odoo.read('res.partner', fields=['name', 'email'], limit=5)
for p in partners:
print(p)
3. Create a record
partner_id = odoo.create('res.partner', {
'name': 'Bruce Wayne',
'email': 'batman@gotham.com'
})
print("New Partner ID:", partner_id)
4. Update a record
odoo.write('res.partner', [partner_id], {'phone': '+123456789'})
5. Delete a record
odoo.unlink('res.partner', [partner_id])
6. Call a custom method
has_rights = odoo.call_method(
'res.partner',
'check_access_rights',
['read'],
{'raise_exception': False}
)
print("Has read access:", has_rights)
📦 Project Structure
odoo_connector/
├── odoo_connector/
│ ├── __init__.py
│ └── api.py
├── tests/
│ └── test_connector.py
├── setup.py
├── README.md
└── LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_connector_datoulobase-0.1.0.tar.gz.
File metadata
- Download URL: odoo_connector_datoulobase-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd54477fbab961a7a594b0ee22b553b7b74592f497504060bfbf8c95e52436d7
|
|
| MD5 |
2af19b1a062eecb56c6662a36d9f5f97
|
|
| BLAKE2b-256 |
2bce38fc13139c93e7a20b295bfcedc8222947303a2aef7c033d6b34638c5757
|
File details
Details for the file odoo_connector_datoulobase-0.1.0-py3-none-any.whl.
File metadata
- Download URL: odoo_connector_datoulobase-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7bbeee86e6e425fdc602f8df9407ca250df89a1f57a0dfe34354034933a49aa
|
|
| MD5 |
92065ed95298845fcefb83bf73ae9685
|
|
| BLAKE2b-256 |
c9bd5e06bf593a0872d2a7c70cc8b4810e524b6c701b1c2f88ae6beebc457df9
|