Connect to a remote Odoo instance via the odoorpc library.
Project description
Base External System Odoo-rpc
Base External System OdooRPC
This module adds an external system adapter for connecting to another Odoo instance using the Python odoorpc client (JSON-RPC).
It is built on top of base_external_system and implements a new adapter model:
external.system.odoo (System Type: External System RPC)
The adapter supports:
Validating required connection parameters (host, port, database, username, password)
Optional SSL transport (JSON-RPC over SSL)
A context-managed client lifecycle via the base_external_system adapter contract (open client, perform calls, logout/cleanup)
Typical use cases include:
Reading data from a legacy Odoo (e.g. Odoo 8/9/10) into a newer Odoo (e.g. Odoo 16)
Synchronizations, migrations, or import tools that must query remote models (e.g. stock.production.lot, stock.move, res.partner) via RPC
Table of contents
Installation
This module requires the Python package odoorpc to be installed in the same environment as your Odoo server.
Install it with pip, for example:
pip install odoorpc
Then install the Odoo module in the Apps menu as usual.
If you run Odoo in Docker or another containerized setup, ensure the dependency is present in the image that runs the Odoo server.
Configuration
Go to Settings → External Systems (menu provided by base_external_system).
Create a new record.
Set System Type to External System RPC (external.system.odoo).
Fill in the connection parameters:
Host (e.g. odoo-test.odoo.org)
Port (e.g. 443 or 8069)
Database name
Username
Password
SSL toggle (if applicable)
Save the record.
After saving, the adapter interface record is created automatically by base_external_system and is available via the interface field.
Usage
Test connection (UI)
Open an external system record configured with System Type External System RPC and click the Test Connection button.
If successful, the adapter will report success (using the success mechanism provided by base_external_system).
Using the client in code
Use the standard context manager from base_external_system:
system = self.env.ref("your_module.external_system_odoo_remote")
with system.client() as odoo:
partner_model = odoo.env["res.partner"]
ids = partner_model.search([("is_company", "=", True)], limit=10)
data = partner_model.read(ids, ["name"])
The yielded object is an odoorpc.ODOO client instance, so any remote model can be accessed via odoo.env["model.name"].
Legacy helper (optional)
Some projects historically called a helper directly on the adapter record:
odoo = system.interface._connect()
If your adapter keeps that helper for backward compatibility, it returns the same client object as external_get_client().
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Contributors
Therp BV <https://therp.nl>
Nikos Tsirintanis <ntsirintanis@therp.nl>
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
This module is part of the OCA/server-backend project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
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 Distributions
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_addon_base_external_system_odoorpc-16.0.1.0.0.3-py3-none-any.whl.
File metadata
- Download URL: odoo_addon_base_external_system_odoorpc-16.0.1.0.0.3-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f172eb123ace97770b0044630ce9c45cd0a833585fc152d43fed541eb5ab85a2
|
|
| MD5 |
00a3a04311cb3f177c67e603e2984a6f
|
|
| BLAKE2b-256 |
9204d2a5b3bb3c64c56f304b1507e4b961bfd1b44f012697ba0bbda48f7daecf
|