Skip to content

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

License

Notifications You must be signed in to change notification settings

roboes/odoo-woocommerce-sync

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, and orders (including line items).
  • 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.
  • 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

  • Performance: Updating product variations may take long, as each variable product is processed through a separate WooCommerce REST API call.
  • 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 download and install the required and optional Odoo add-ons listed below, follow the instructions in odoo-module-dependency-installer.md.

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 Menu > Settings > Users & Companies > Users > Select the user > Sales > Sales > Administrator.
  • Invoicing (account)
    • The user should have Billing Administrator privileges:
      • Home Menu > Settings > Users & Companies > Users > Select the user > Accounting > Invoicing > Billing Administrator.
    • Configure Fiscal Localization:
      • Home Menu > Settings > Invoicing > Fiscal Localization > Package > Set the Fiscal Localization package (e.g. Germany SKR04 - Accounting).
    • Enable full accounting features:
      • Home Menu > Settings > Users & Company > Groups > Select the Technical / Show Full Accounting Features group > Add a line > Select the user.
  • Sales (sale_management)
    • Enable Product Variants:
      • Home Menu > Settings > Sales > Product Catalog > Enable Variants.
  • Inventory (stock)
    • Enable Delivery Methods:
      • Home Menu > Settings > Inventory > Shipping > Enable Delivery Methods.
    • (Optional) Enable Product Packagings:
      • Home Menu > Settings > Inventory > Products > Enable Product Packagings.
    • Enable Units of Measure:
      • Home Menu > Settings > Inventory > Products > Enable Units of Measure.
    • (Optional) Set up a dedicated warehouse for WooCommerce sales:
      • Home Menu > Settings > Inventory > Warehouse > Enable Storage Locations and configure under Locations the warehouse accordingly.
  • Contacts (contacts)
  • Job Queue (queue_job)

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_fiscal): 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:

  • Cadastro de Pessoa Física (CPF) (l10n_br_cpf_code field) and Cadastro Nacional da Pessoa Jurídica (CNPJ) (cnpj_cpf field): Requires the Brazilian Market on WooCommerce plugin.

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 WooCommerce > Settings > Advanced > REST 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 Menu > Apps 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 Menu > WooCommerce Sync.

For orders import, two optional mapping logics can be activated. By default, a product and customer (for orders placed by guest customer) placeholder/dummy is created. 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.

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

  • Odoo-Shore POS Sync: Connector add-on for Odoo that synchronizes data between Shore POS and Odoo.

About

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

Resources

License

Stars

Watchers

Forks