Skip to content

Add one-way Odoo contact sync script (Option B) - #1

Open
classicitbb wants to merge 2 commits into
mainfrom
codex/sync-contacts-across-multiple-odoo-databases
Open

classicitbb wants to merge 2 commits into
mainfrom
codex/sync-contacts-across-multiple-odoo-databases

Conversation

@classicitbb

Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple "Option B" one-way sync to propagate contact changes from a primary Odoo DB to multiple target Odoo DBs.
  • Attempt to deduplicate records using a shared x_global_uuid custom field and fall back to normalized email/phone matching.
  • Surface ambiguous matches as conflicts so they can be resolved manually.
  • Maintain progress with a state file so only recent changes are synced.

Description

  • Add sync_contacts.py which implements an XML-RPC OdooClient, ensures the x_global_uuid field exists, fetches recent contacts, finds matches, and creates/updates targets via create/write calls.
  • Implement matching and conflict logic in functions such as find_match, prepare_payload, sync_contact, and the top-level sync_contacts.
  • Add config.example.yaml with primary, targets, and sync settings and a requirements.txt that pins PyYAML==6.0.2 for configuration parsing.
  • Add README.md documenting setup, usage (python sync_contacts.py --config config.yaml --state state.json), and notes about conflicts.log and state.json.

Testing

  • No automated tests are included in this change.
  • No automated tests were executed as part of this rollout because none were provided.
  • Basic repository operations (adding and committing the new files) completed successfully.
  • Runtime or integration validation against Odoo instances was not performed by automated tests.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant