Use Odoo external API via XML-RPC or JSON-RPC with uid authentication, or REST in newer endpoints, calling execute_kw on models like product.product, sale.order, and stock.picking. Respect create/write constraints, batch in chunks, store external IDs on custom fields, and use cron or queue workers with idempotency keys and error logging for reliable two-way sync.
Steps
- Create dedicated integration user with least-privilege groups and API key if on Odoo 14+.
- Prototype read search_read on target models with domain filters and field lists.
- Add x_external_id or integration reference fields for upsert matching.
- Implement create/write with context tracking_disable or mail not suppressed per policy.
- Use @api.model_create_multi patterns in custom imports for performance on bulk loads.
- Wrap calls in retry with exponential backoff; handle concurrent update exceptions.
- Monitor ir.logging or application logs; alert on failed job queue entries.
Common mistakes
- Using admin user for integrations without rate limits.
- Writing related records in separate calls without transactions causing orphans.
- Ignoring required fields on stock.move.line during picking imports.
- Skipping timezone on datetime fields in JSON payloads.
- Full table scans without indexed domains slowing production.
Odoo version notes
XML-RPC and JSON-RPC are stable on Odoo 16–18 Community and Enterprise. Official REST improves gradually—verify docs per version. Odoo.sh may throttle long jobs; use queue_job OCA. External API deprecations are rare but test staging on each minor upgrade.
When to bring in help
If the fix touches custom modules, regulated traceability, or production outages, a focused rescue sprint beats months of trial and error. See our Odoo service.