Contributors mailing list archives

Browse archives


Re: New module for data synchronization between Odoo instances

Sunflower IT, Tom Blauwendraat
- 19/03/2021 16:56:18

Hi Daniel

Whichever solution you choose, at least I would recommend to rely on 'queue_job' or any other module for asynchroneous job execution. If you use auditlog as a base, I assume your design is to perform a direct action once a record changes. But you don't want the user to wait on such a sync as he is saving the record, you want it to be done in the background, and should it fail for some reason you want it to be retried X times before giving up and notifying.

'Connector' module is following the same logic and also has several handy classes to facilitate dependent model sync.

You might also want to look at base_import_odoo by Holger, in there he's solved some pretty horrid technical corner cases such as the 'chicken and egg' problem that arises if you have a circular dependency in your model structure, eg. a partner record having a bank account which has the same partner as a follower - which record do you sync first? Base_import_odoo is not bidirectional though.

Lastly, I have an abandoned attempt here:

The idea here was to have an external tool handle the sync between the both Odoo's and the model structure defined in declarative YAML files. "Labeling" the records is done via XMLids, so that you don't have to add any new fields into Odoo - it can work for a vanilla Odoo instance. I thought the design was pretty neat, and it already works for simple cases, but I never got around to finishing it.

Good luck!


Op 3/19/21 om 3:27 PM schreef Daniel Reis:

the best repo for a module like this one can be

I'm not convinced, because that repo has no code and no activity.
I think OCA/server-tools might be a betetr candidate.

A question: why do you use audit_log as base and not ?

The problem has three big components:
1) capture events
2) pull/push between instances, and
3) apply/replay events.

The connector might be useful for 2) to push/pull data between instances.
For 1) audilog is the best starting point I found.
For 3) I'm still looking at the details, maybe base_synchro hos goos ideras to use.

Daniel Reis
Managing Director
M: +351 919991307
Av Doutor Desidério Cambournac 12 • 2710-553 Sintra, Portugal

Post to: