Overview
This covers the development of a RouteLogic connector module for Odoo, built to keep delivery and pickup operations synchronized between Odoo's stock picking workflow and RouteLogic's route-planning platform. The connector pushes delivery/pickup tasks from Odoo to RouteLogic via its API and listens for RouteLogic webhook events to keep task status, notes and package counts up to date in Odoo in real time.
Business Challenge
The client planned and tracked deliveries in RouteLogic but managed the underlying stock transfers in Odoo, with no link between the two. They needed every delivery and pickup created in Odoo to automatically appear as a task in RouteLogic and needed status changes, driver notes and task removals made in RouteLogic to flow back into Odoo without creating conflicting updates or breaking completed transfers.
Solution & Approach
The connector was built from the ground up over a focused development sprint, moving from a working one-way push to a stable, loop-safe, two way sync:
- Set up a developer account on RouteLogic, reviewed its API documentation and endpoints and built the base module for RouteLogic–Odoo synchronization.
- Implemented task creation via API calls when a delivery or pickup is confirmed in Odoo, applying Incoterms conditions, mapping fields between Odoo and RouteLogic and storing the RouteLogic task UUID against the stock picking record.
- Added success/error messaging on both the delivery portal and the picking Chatter, driven by the actual API response, so users can see whether a task synced correctly.
- Made the integration fully configuration-driven: added a RouteLogic Connector section to Sales settings for the API key, webhook name, description, URL and event selection, with buttons to connect and update webhook groups via the API removing the earlier hardcoded API key.
- Built a controller to receive RouteLogic webhook calls (task update, visit status update, task deletion) and route each event to the correct logic in Odoo.
- Diagnosed and fixed a feedback-loop issue where updates in Odoo triggered webhooks that re-updated Odoo; resolved it with a flag on the stock picking record and controller-side checks to break the loop.
- Added safeguards so that once a picking is done or cancelled, incoming webhooks only update notes and task status rather than protected fields avoiding Odoo's transfer-locking errors.
- Implemented a status field on stock picking (defaulting to Not Planned) driven by the visit_status_updated webhook, after discovering the task_updated webhook and API did not reliably expose RouteLogic's task status.
- Added a webhook to surface driver-generated internal notes from the RouteLogic driver app directly on the picking Chatter.
- Implemented task-deletion handling, adjusting the logic with the client from deleting the whole picking to removing only the task reference, based on real-world testing.
- Synchronized the package_count module with the connector, added an En-route field on stock picking and mapped package count through to RouteLogic tasks.
- Ran the full workflow through client demos and WhatsApp check-ins at each stage, testing on the development branch before finalizing scope with the client.
Key Technical Highlights
- Two way sync between Odoo stock pickings and RouteLogic tasks, covering creation, updates, status, notes and deletion.
- Configuration driven setup API key, webhook events and endpoints managed from Odoo Settings, no hardcoded credentials.
- Feedback-loop prevention between Odoo writes and RouteLogic webhooks.
- Safe handling of done/cancelled transfers to avoid Odoo's built-in transfer-lock errors.
- Driver notes and task status visible directly on the picking Chatter for full traceability.
Outcome
The result is a working RouteLogic–Odoo connector that keeps delivery and pickup tasks in sync in both directions from creation through status changes to completion with package counts, notes and Incoterms handled automatically and safely, giving the client a single accurate view of delivery operations across both systems.
Technology Stack
Odoo (Stock/Inventory, Sales Settings, Chatter), RouteLogic REST API & Webhooks, Python.