PS PrestaShop Intermediate

Odoo Connector — Complete Guide

Install, configure and run the real-time PrestaShop ⇄ Odoo sync (products, stock, orders, customers) for PrestaShop 8 and 9.

Updated Module version 1.0.0

The Odoo Connector syncs your products, stock, orders and customers between PrestaShop and Odoo in real time and in both directions. This guide covers installation, connecting to Odoo, choosing the sync direction, the initial sync, the cron, the inbound webhook and troubleshooting.

Requirements

  • PrestaShop 8.0 to 9.x.
  • PHP 7.4 to 8.3 with the cURL extension enabled.
  • An Odoo 14 to 18 instance (online or self-hosted) reachable over HTTPS from your PrestaShop server.
  • An Odoo user with an API key and rights on the Sales, Inventory and Contacts models.

The module talks to Odoo over JSON-RPC. The PHP xmlrpc extension, removed in PHP 8, is not required.

Installation

  1. In the back office, open Modules > Module Manager, then Upload a module and drop the dfodooconnect.zip file.
  2. Once installed, open the configuration page via the Configure button or the Odoo Connector tab in the admin menu.

Generate an API key in Odoo

  1. Log in to Odoo with the service account dedicated to the sync.
  2. Open Preferences > Account Security > API Keys and generate a new key.
  3. Copy the key: it replaces the password in the module configuration.

Create a dedicated Odoo user (for example “PrestaShop Sync”) rather than using a personal admin account. You keep a clear audit trail on the Odoo side.

Connecting to Odoo

On the configuration page, fill in the four fields of the Odoo connection block:

  • Odoo URL: the full address of your instance, e.g. https://my-odoo.com.
  • Database: the exact Odoo database name.
  • User: the login of the service account.
  • API key: the key generated in the previous step.

Click Test connection. On success, the module shows the detected Odoo version and the user id (uid). Save, then tick Enable synchronization.

As long as Enable synchronization is unchecked, no data is sent to Odoo, even if the connection is valid.

Choosing entities and sync direction

Four entities are handled. For each, you enable or disable the sync; for products and stock, you also choose the direction.

  • Customers: PrestaShop to Odoo (res.partner contacts).
  • Products: PrestaShop to Odoo, Odoo to PrestaShop, or bidirectional.
  • Stock: PrestaShop to Odoo, Odoo to PrestaShop, or bidirectional.
  • Orders: PrestaShop to Odoo (sale.order sales orders).

Two options round out order behaviour: Automatically confirm the order in Odoo (turns the quotation into a confirmed sales order) and Generate the Odoo invoice.

Initial sync

Before enabling the real-time flow on an existing store, populate Odoo with your current data from the Initial sync block:

  1. Export all customers: queues every customer for export.
  2. Export all products: required before stock and orders, because order lines and stock adjustments rely on the product mapping.
  3. Export all orders: run after customers and products.

Keep the order customers → products → orders. The module handles missing dependencies automatically (it queues an unmapped product before retrying the order), but the right order reduces the number of retries.

Cron setup

The cron drains the queue (retries failed pushes) and pulls stock from Odoo when that direction is enabled. Schedule the URL shown in the Endpoints block, every 1 to 5 minutes:

curl "https://your-store.com/module/dfodooconnect/cron?token=YOUR_TOKEN"

The token is generated automatically at install and shown in the configuration.

Inbound webhook (Odoo to PrestaShop)

So that changes made in Odoo flow back in real time, create an Automated Action in Odoo (a server action of type webhook) that sends a JSON POST request to the module’s webhook URL.

Stock update:

{ "token": "YOUR_TOKEN", "entity": "stock", "odoo_id": 42, "qty": 17 }

Order-state change:

{ "token": "YOUR_TOKEN", "entity": "order_state", "odoo_id": 99, "state": "cancel" }

Recognised states are cancel, sale and done, mapped respectively to Canceled, In preparation and Delivered on the PrestaShop side.

The webhook token must match the one shown in the configuration. A request without a valid token is rejected with a 403 code.

Dashboard and log

The dashboard permanently shows four queue indicators (Pending, Synced, Error, Dead-letter), the number of mappings per entity, and a timestamped activity log. Two maintenance actions are available: Process the queue now and Pull stock from Odoo.

The resilient queue

Every change in PrestaShop is first pushed to a queue, then sent to Odoo immediately on a best-effort basis. If Odoo is unreachable, the job stays in the queue and the cron replays it automatically. After the configured number of attempts (5 by default), a permanently failing job moves to quarantine (Dead-letter) so it doesn’t block the rest of the queue.

This mechanism is what guarantees that an Odoo outage never blocks your customers’ checkout.

Synced fields

Customers

Name, email, company, reference, default address (street, city, postal code, phone), VAT number and country. De-duplication matches by email.

Products

Name, internal reference, sale price, cost price, weight, barcode, short description and active state. De-duplication matches by reference.

Stock

Available quantities are applied via an inventory adjustment on the configured Odoo location (or the first internal location if none is set).

Orders

Partner, customer reference, order lines (product, quantity, unit price excluding tax) and shipping. The customer is synced on the fly if it hasn’t been already.

Dry-run mode

Enable Dry-run mode to validate the mapping without writing anything to Odoo: each operation is recorded in the log with a DRY-RUN note, but no data is created or modified. Ideal for acceptance testing before going live.

Troubleshooting

  • The connection test fails: check the URL (with https), the exact database name, the login and the API key. Make sure the PrestaShop server can reach the Odoo instance outbound.
  • An order stays pending: a product in the order is probably not mapped yet. The module queues the product; run “Process the queue now” again after a few seconds.
  • Stock doesn’t come back into PrestaShop: check that the stock direction includes Odoo to PrestaShop and that the cron runs.
  • Duplicates on the Odoo side: make sure product references and customer emails are filled in; they are the matching keys.

Uninstall

Uninstalling removes the module’s mapping, queue and log tables. Your data in Odoo is not affected. For a simple update, replacing the files is enough: the schema and mappings are preserved.

Was this page helpful?

Still stuck? Contact support