Skip to content

Repository files navigation

Odoo-WooCommerce Sync

Odoo-WooCommerce Sync


"Buy Me A Coffee"

Description

The Odoo-WooCommerce Sync add-on enables synchronization between WooCommerce and Odoo. The main features are:

  • WooCommerce to Odoo: Synchronize new and existing products (including variations), stock quantity levels, customers (including a separate shipping address contact), and orders (including line items, fee lines, coupon lines and full refunds converted into Odoo credit notes).
  • Odoo to WooCommerce: Synchronize new and existing products (including variations) and stock quantity levels.
  • Extended Models and Views: Enhance existing Odoo models and views for product.template, product.product, res.partner, sale.order, and sale.order.line to accommodate corresponding WooCommerce REST API fields.
  • Automated and Manual Synchronization: A built-in cron job scheduler enables regular synchronization, complemented by a dedicated button for manually triggering updates. Optional WooCommerce webhooks (order/product/customer changes) can also be registered for near-real-time sync, in addition to the regular polling.
  • Advanced Settings: Support for multiple WooCommerce websites with specific configuration options for each instance (e.g. syncing only products from WooCommerce to Odoo).
  • Image Synchronization: Optionally synchronize product images from WooCommerce to Odoo and Odoo to WooCommerce. For products imported from WooCommerce that include multiple images/product image gallery, an additional product image gallery is added to the product.template view.
  • Language Filtering: Synchronize products by language (requires Polylang).
  • Orders Transactions Fee Support: Integrates additional fee fields into orders processed with PayPal and Stripe (requires the respective plugins).

Some features require additional setup, as detailed in the Requirements section.

Warning

This add-on is provided without any warranty and may contain bugs as it is a recently developed solution. Testing in a controlled environment is recommended before deployment, and usage is at one's own risk.

Limitations

  • Stock Management: If a WooCommerce product variation's "Manage Stock" setting is modified, the corresponding parent product in Odoo is removed. This requires a complete re-import of the parent product and its variations, which can be manually retriggered by pressing the Sync Now button.
  • Unique SKU Requirement: Every product must have a unique SKU. For product variations, both the parent product and each individual variation must possess a SKU. In Odoo, the internal reference field (default_code) should be used to store this value.
  • Media Endpoints: The WooCommerce REST API itself does not provide direct access to media endpoints. Instead, media management (such as uploading images) is handled by the core WordPress REST API.

Requirements

Odoo

Python Dependencies

Install the necessary Python packages by running:

python -m pip install filetype phonenumbers woocommerce

Odoo Add-ons (Required)

Tip

To automatically apply the Odoo configuration listed below, follow the instructions in odoo-settings-configuration.md.

  • Products & Pricelists (product)
    • The user should have Administrator privileges:
      • Home MenuSettingsUsers & CompaniesUsers → Select the user → SalesSalesAdministrator.
  • Invoicing (account)
    • The user should have Billing Administrator privileges:
      • Home MenuSettingsUsers & CompaniesUsers → Select the user → AccountingInvoicingBilling Administrator.
    • Configure Fiscal Localization:
      • Home MenuSettingsInvoicingFiscal LocalizationPackage → Set the Fiscal Localization package (e.g. Germany SKR04 - Accounting).
    • Enable full accounting features:
      • Home MenuSettingsUsers & CompanyGroups → Select the Technical / Show Full Accounting Features group → Add a line → Select the user.
  • Sales (sale_management)
    • Enable Product Variants:
      • Home MenuSettingsSalesProduct Catalog → Enable Variants.
  • Inventory (stock)
    • Enable Delivery Methods:
      • Home MenuSettingsInventoryShipping → Enable Delivery Methods.
    • (Optional) Enable Product Packagings:
      • Home MenuSettingsInventoryProducts → Enable Product Packagings.
    • Enable Units of Measure:
      • Home MenuSettingsInventoryProducts → Enable Units of Measure.
    • (Optional) Set up a dedicated warehouse for WooCommerce sales:
      • Home MenuSettingsInventoryWarehouse → Enable Storage Locations and configure under Locations the warehouse accordingly.
  • Contacts (contacts)
  • Job Queue (queue_job)
  • Multiple Images Base (base_multi_image): Extends the functionality of any model to support multiple attached images (a gallery) and enables full management of them.

Taxes and Prices

Odoo taxes created by this add-on match the Tax Calculation setting on the WooCommerce Configuration record's Sync Items tab (Match Odoo Company Settings by default, Tax Included, or Tax Excluded) - not WooCommerce's own Prices entered with tax setting. Match Odoo Company Settings (the default) uses whatever convention is already configured for the Odoo company (Home MenuSettingsInvoicingTaxesPurchase Tax Prices). Product, variation and order line prices synced from WooCommerce are automatically converted (grossed up or stripped of tax) to match this same convention before being stored on list_price/price_unit, so no manual price adjustment is needed regardless of how the two systems differ.

This mirrors Odoo's own B2B (tax excluded) vs. B2C (tax included) pricing guidance: register product prices with taxes excluded or included, but not both together - if all prices are managed with tax included (or excluded) only, Odoo can still easily do a sale order with a price having taxes excluded (or included) instead.

Odoo Add-ons (Optional)

While not mandatory, the following Odoo Community Association (OCA) add-ons are recommended to enhance functionality:

  • Module Auto Update (module_auto_update): Automatically updates installed modules to their latest versions, ensuring the system remains current with minimal manual intervention.
  • Scheduled Actions as Queue Jobs (queue_job_cron): Extends the functionality of queue_job and allows to run an Odoo cron as a queue job.
  • Product Dimension (product_dimension): Adds fields for length, width, height, and unit of measure, enabling detailed management of product dimensions.
  • Product - Many Categories (product_multi_category): Enhances the standard single-category assignment (categ_id) by introducing a categ_ids field, allowing products to be organized into multiple categories.
  • Product Brand Manager (product_brand): Adds a product_brand_id field to facilitate the import and management of product brands from WooCommerce (requires WooCommerce 9.6+) (only one brand per product allowed).
Odoo Localization (Optional)

Brazil:

  • Módulo Fiscal Brasileiro (l10n_br_base, l10n_br_sale): Supports Cadastro de Pessoa Física (CPF), Cadastro Nacional da Pessoa Jurídica (CNPJ), local taxes, shipping costs, and electronic fiscal documents.

WordPress

WordPress Plugins (Optional)

WordPress Localization (Optional)

Brazil:

Installation

Follow these steps to install the Odoo-WooCommerce Sync add-on:

  1. Install Python Dependencies: Ensure the Python dependencies are installed on the Odoo instance.
  2. Enable Odoo Add-ons: Install and activate all required and, if applicable, optional Odoo add-ons.
  3. Configure WordPress (if applicable): Install and set up the optional plugins for WordPress. Retrieve the WooCommerce REST API consumer key and consumer secret from WooCommerceSettingsAdvancedREST API.
  4. Add the Add-on: Download and place the woocommerce_sync directory into the Odoo addons directory.
  5. Activate Debug Mode: Log in to Odoo and enable Debug Mode.
  6. Update the Apps List: Navigate to Home MenuApps and click Update Apps List.
  7. Activate the Add-on: Use the filter to search for woocommerce_sync and activate the add-on.

Configuration

The add-on is configured through the WooCommerce Sync configuration, accessible via Home MenuWooCommerce Sync.

For order imports, two mapping logics are enabled by default. If disabled, the system instead falls back to placeholders: a customer placeholder (for guest checkouts) and a product placeholder. The options are:

  • Guest Customers Mapping: When enabled, orders placed by guest (unregistered) customers are matched to existing Odoo customers using their email addresses. If no matching customer exists, a new record is created automatically. When disabled, a customer placeholder (ref = WooCommerce_Customer_Placeholder) is assigned to the order.
  • Line Items Product Mapping: When enabled, each line item is mapped to an existing Odoo product using the woocommerce_product_id. If no match is found, a product placeholder is used. When disabled, all order line items are assigned to a placeholder product (default_code = WooCommerce_Product_Placeholder) while still displaying the WooCommerce product name. This option is not recommended since product details in WooCommerce may change over time, complicating accurate mapping.

WooCommerce webhooks (WooCommerce Webhooks group) are optional and disabled by default. When enabled, this Odoo instance must be reachable from WooCommerce at its configured base URL, since WooCommerce delivers webhook events to <base_url>/woocommerce_sync/webhook/<connector_id>.

Disclaimer

This module is an independent third-party integration. It is not affiliated with, endorsed by, or sponsored by Odoo S.A. or Automattic Inc.

All copyrights and trademarks are the property of their respective owners.

References

See also

About

Odoo-WooCommerce Sync is a connector add-on for Odoo that synchronizes data between WooCommerce and Odoo.

Resources

Stars

40 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages