Skip to main content

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


Download files

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

Source Distribution

odoo_connector_datoulobase-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odoo_connector_datoulobase-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file odoo_connector_datoulobase-0.1.0.tar.gz.

File metadata

File hashes

Hashes for odoo_connector_datoulobase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cd54477fbab961a7a594b0ee22b553b7b74592f497504060bfbf8c95e52436d7
MD5 2af19b1a062eecb56c6662a36d9f5f97
BLAKE2b-256 2bce38fc13139c93e7a20b295bfcedc8222947303a2aef7c033d6b34638c5757

See more details on using hashes here.

File details

Details for the file odoo_connector_datoulobase-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_connector_datoulobase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7bbeee86e6e425fdc602f8df9407ca250df89a1f57a0dfe34354034933a49aa
MD5 92065ed95298845fcefb83bf73ae9685
BLAKE2b-256 c9bd5e06bf593a0872d2a7c70cc8b4810e524b6c701b1c2f88ae6beebc457df9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page