Skip to content

Template — Sync inventory between WooCommerce and Odoo

If WooCommerce and Odoo hold stock separately, they drift apart and you oversell. This template keeps inventory aligned: it reads stock from the source of truth and pushes updates to the other system, on a schedule or when stock changes.

Scheduler (every N minutes) ·or· Odoo stock change
↓
Odoo: Read stock levels (source of truth)
↓
Iterator (per SKU) → Data Store (compare with last synced value)
↓
Decision (changed?) → WooCommerce: Update Product (stock)
NodePurpose
SchedulerRun the sync every N minutes
Odoo (Read / API)Read stock from the ERP (source of truth)
IteratorProcess each SKU
Data StoreRemember the last synced quantity (only push changes)
WooCommerce — Update ProductWrite the new stock level
  • Pick one source of truth (usually the ERP) to avoid sync loops.
  • Use Data Store to push only SKUs whose quantity actually changed.
  • Map by SKU, not internal IDs, so both systems agree on the product.