Getting Started¶
This guide walks through a minimal two-node sync using sync_base and sync_http.
No Kubo sidecar is needed.
For the Kubo path, see Kubo / IPFS Transport.
Installation¶
Clone the repository and install the Python dependencies:
git clone https://github.com/odoostan/odoo-sync pip install -r addons/sync_base/requirements.txt
Add
addons/to your Odoo addons path:# odoo.conf addons_path = ...,/path/to/odoo-sync/addons
In Odoo, go to Apps and install Sync Base (
sync_base) and Sync HTTP (sync_http). Repeat on the second instance.
Note
Install these addons on two Odoo instances in order to test export, delivery and import end-to-end.
Step 1 — Create a Swarm¶
On Instance A:
Go to Sync ▸ Network ▸ Swarms ▸ New.
Set Name (e.g.
My First Swarm) and Network Type:HTTP.Save — the local gateway node is created automatically and appears in the Nodes tab.
Repeat on Instance B with the same name (the name is local; it does not need to match across instances).
Step 2 — Register a Foreign Node¶
Each instance needs to know about the other.
On Instance A:
Open the swarm you just created and go to the Nodes tab ▸ New.
Fill in Odoo URL (the base URL of Instance B, e.g.
http://odoo-b:8069) and Odoo API Key (an API key generated on Instance B under Settings ▸ Users ▸ API Keys).Click Test Connection — it should return the remote Odoo version.
Note
The API key is visible only to users in the sync_manager group.
The local gateway uses the remote node’s key when posting events, so Instance B can match the key to a local user and enforce its own access rules.
Repeat on Instance B, pointing at Instance A.
Step 3 — Create a Topic¶
A topic is the central configuration object. It binds a schema to a swarm and controls export/import/delivery behaviour.
Go to Sync ▸ Topics ▸ Topics ▸ New.
Set Name, choose the Schema (create one first — see Step 4 below), and select the Swarm.
Set Export Mode:
Instant, Import Mode:Instant, Delivery:Push.Save — the automation and cron records are created automatically.
Tip
For high-volume models, switch Export Mode or Import Mode to Batch so the three-pass DataLoader processes events in bulk rather than record by record.
Step 4 — Create a Schema¶
A schema describes the wire format (JSON Schema) and the mapping between JSON paths and Odoo fields.
Go to Sync ▸ Schemas ▸ Schemas ▸ New.
Set Target Model (e.g.
res.partner).Fill Data Schema with a draft-07 JSON Schema for the payload.
Fill Odoo Schema with the mapping. See Odoo Schema for the full operator reference.
Save —
ip.schema._check_schemas()validates both schemas and raises aValidationErrorif any field path or operator is invalid.
Minimal example for res.partner:
{
"__root__": { "match": { "ref": "ext_ref" }, "on_miss": "create" },
"ref": "ext_ref",
"name": "name",
"email": "email"
}
__root__ with match tells the importer to find-or-update an existing partner by ref, or create one when none is found.
See Odoo Schema for the full operator reference.
Step 5 — Trigger a Sync¶
On Instance A, open a record that matches the topic’s
ip.topic.export_domain(leave it empty to match all records of the target model).Save the record — the Instant automation fires and creates an
ip.eventwithdirection='outbound'androuting_state='pending'.Go to Sync ▸ Content ▸ Events — the event should transition:
pending→sending→sent.On Instance B, go to Sync ▸ Content ▸ Events — you should see a matching inbound event with
mapping_state='mapped', and the partner record should exist.
Tip
On a staging or development database, outbound automations are automatically disabled to prevent test data from reaching production peers. Re-enable the automation explicitly if you intend to use this database as a live node. See Configuration for details.
See also
Events — event state machines and troubleshooting.
Odoo Schema — Odoo Schema operators, traits, and cookbook.
Kubo / IPFS Transport — Kubo/IPFS transport setup.