Overview
Full bidirectional integration between Odoo and WooCommerce. Imports products, categories, customers, orders, and tax rates with webhook support for real-time sync.
Key Features
- WooCommerce REST API connection
- Product import with variations and images
- Category hierarchy import
- Customer import with addresses
- Order import with line items
- Tax rate synchronization
- Webhook real-time updates
- Webhook logging with payload inspection
- Bidirectional product sync
- Auto-cleanup of old logs
Data Models
Webhook Log
woocommerce.webhook.log| Field | Type | Info |
|---|---|---|
Topic
topic
|
Char | Required Event type |
Status
status
|
Selection | Success/error |
Payload
payload
|
Json | Data |
Extends Existing Models
res.partner product.template product.category account.tax
Adds 2 fields:
Adds actions: create_or_update_from_woo
Documentation
WooCommerce Integration for Odoo 19
Comprehensive integration module for syncing WooCommerce products, customers, orders, and related data with Odoo 19.
Table of Contents
1. [Overview](#overview)
2. [Features](#features)
3. [Requirements](#requirements)
4. [Installation](#installation)
5. [Configuration](#configuration)
6. [Usage](#usage)
7. [Data Mapping](#data-mapping)
8. [Troubleshooting](#troubleshooting)
9. [Documentation](#documentation)
Overview
This module provides comprehensive integration between WooCommerce and Odoo 19, allowing you to import and synchronize data from your WooCommerce store.
Features
Import Features
- ✅ Import Products (with variations, images, and attributes)
- ✅ Import Customers (with billing/shipping addresses)
- ✅ Import Orders (with order lines and taxes)
- ✅ Import Product Categories (hierarchical)
- ✅ Import Product Attributes & Tags
- ✅ Import Taxes
- ✅ **3-Pass Product Import** - Simple → Variable → WooSB bundles (handles dependencies)
- ✅ Import wizard for selective data import
- ✅ Import logging and tracking
- ✅ Scheduled automatic imports (cron jobs)
- ✅ Support for multiple WooCommerce stores
Bidirectional Sync Features
- ✅ **Real-time webhooks** - Instant updates from WooCommerce
- ✅ **Push changes to WooCommerce** - Products, customers, orders, categories, attributes, tags, taxes
- ✅ **Stock synchronization** - Auto-sync inventory changes
- ✅ **Image sync** - Import/export product images and galleries
- ✅ **Partial updates** - Only sync changed fields for efficiency
- ✅ **WooSB Bundle Support** - Full support for WooCommerce Product Bundles
Requirements
Python Dependencies
Install the required Python packages:
pip install woocommerce --break-system-packages pip install requests --break-system-packages
WooCommerce API Setup
1. In your WooCommerce store, go to **WooCommerce → Settings → Advanced → REST API**
2. Click **Add Key**
3. Set the following:
- Description: `Odoo Integration`
- User: Select your admin user
- Permissions: `Read/Write`
4. Click **Generate API Key**
5. Save the **Consumer Key** and **Consumer Secret**
Installation
1. Copy the `woocommerce_integration` folder to your Odoo addons directory
2. Update the addons list in Odoo
3. Install the module from Apps
Configuration
1. Go to **WooCommerce → Configuration → WooCommerce Stores**
2. Click **Create** to add a new configuration
3. Enter your WooCommerce store details:
- **Configuration Name**: A friendly name for this store
- **WooCommerce URL**: Your store URL (e.g., https://mystore.com)
- **Consumer Key**: From WooCommerce API settings
- **Consumer Secret**: From WooCommerce API settings
- **API Version**: Usually `wc/v3`
4. Configure import settings:
- Select which data types to import
- Set default customer tags and product categories
5. Click **Test Connection** to verify the setup
6. Once connected, use **Import All Data** or **Import Wizard** for selective import
Usage
Manual Import
1. Go to **WooCommerce → Import → Import Wizard**
2. Select the data types to import
3. Set date filters if needed
4. Configure batch size for performance
5. Click **Import**
Automatic Import
The module includes scheduled actions for automatic synchronization:
- Products: Every 6 hours
- Customers: Daily
- Orders: Every hour
You can modify these schedules in **Settings → Technical → Automation → Scheduled Actions**
Viewing Imported Data
- **Products**: WooCommerce → WooCommerce Data → Products
- **Customers**: WooCommerce → WooCommerce Data → Customers
- **Orders**: WooCommerce → WooCommerce Data → Orders
- **Import Logs**: WooCommerce → Import → Import Logs
Data Mapping
Products
- WooCommerce Product → Odoo Product Template
- WooCommerce Variations → Odoo Product Variants
- SKU → Internal Reference
- Price → Sale Price
- Stock Management → Product Type (Storable/Consumable)
Customers
- WooCommerce Customer → Odoo Contact (res.partner)
- Billing Address → Invoice Address
- Shipping Address → Delivery Address
Orders
- WooCommerce Order → Odoo Sale Order
- Order Status mapping:
- pending → Draft
- processing → Sales Order
- completed → Sales Order
- cancelled → Cancelled
Troubleshooting
Connection Issues
- Verify your WooCommerce URL is correct and includes https://
- Check that API keys have Read/Write permissions
- Ensure your WooCommerce REST API is enabled
- Check SSL certificate if verify_ssl is enabled
Import Failures
- Check import logs for detailed error messages
- Verify data in WooCommerce is complete
- Ensure required fields are not empty
- Check Odoo user permissions
Performance
- Reduce batch size for slower connections
- Skip image imports for faster initial sync
- Use date filters to import recent data only
- Schedule imports during off-peak hours
Technical Reference
API Endpoints
| Endpoint | Method | Purpose |
|----------|--------|---------|
| `/woocommerce/webhook/
| `/woocommerce/import_next` | GET | Triggers next import page for all instances |
Cron Jobs
| Job | Interval | Purpose |
|-----|----------|---------|
| `cron_import_customers` | 2 min | Paginated customer import |
| `cron_import_products` | 2 min | 3-pass product import (simple → variable → woosb) |
| `cron_import_orders` | 2 min | Paginated order import |
Models Extended
| Model | WooCommerce Fields Added |
|-------|-------------------------|
| `product.template` | `woo_id`, `woo_type`, `woo_regular_price`, `woo_sale_price`, `woo_stock_status`, `woo_data`, etc. |
| `product.product` | `woo_variant_id`, `woo_variant_regular_price`, `woo_variant_sale_price` |
| `res.partner` | `woo_customer_id`, `woo_username`, `woo_role`, `woo_data` |
| `sale.order` | `woo_order_id`, `woo_status`, `woo_payment_method`, `woo_shipping_total`, `woo_data` |
| `product.category` | `woo_id`, `woo_slug`, `woo_description`, `woo_display` |
| `product.attribute` | `woo_id`, `woo_type`, `woo_order_by`, `woo_has_archives` |
| `product.tag` | `woo_id`, `woo_slug`, `woo_description` |
| `account.tax` | `woo_id`, `woo_class`, `woo_compound`, `woo_shipping` |
| `stock.quant` | Auto-syncs quantity changes to WooCommerce |
Security Groups
| Group | Access |
|-------|--------|
| `group_woocommerce_user` | Read access to all WooCommerce data |
| `group_woocommerce_manager` | Full CRUD access |
Sync Behavior
- **Import-first:** Must complete import before enabling sync (prevents orphan references)
- **Context flag:** Use `skip_woo_sync=True` to prevent sync loops
- **Partial updates:** Only changed fields sent to WooCommerce for efficiency
- **Unique constraints:** `(woo_id, woo_instance_id)` prevents duplicate records
- **Webhook verification:** HMAC-SHA256 signature validation
Import Sequence
Imports must run in this order to satisfy dependencies:
1. **Categories** - Required for product categorization
2. **Attributes** - Required for variable products
3. **Taxes** - Required for order calculations
4. **Customers** - Required for order linking
5. **Products** - 3-pass: simple → variable → woosb bundles
6. **Orders** - References all above entities
Documentation
Getting Started Guide
| File | Description |
|------|-------------|
| [01_api_basics.md](01_api_basics.md) | WooCommerce REST API introduction & authentication |
| [02_product_architecture.md](02_product_architecture.md) | Product data architecture & relationships |
| [03_field_mapping.md](03_field_mapping.md) | WooCommerce to Odoo field mappings |
| [04_variation_import_guide.md](04_variation_import_guide.md) | Product variation import workflow |
API Reference - Products
| File | Description |
|------|-------------|
| [05_product_categories.md](05_product_categories.md) | Categories API endpoints & Odoo mapping |
| [06_product_attributes.md](06_product_attributes.md) | Attributes API endpoints & Odoo mapping |
| [07_product_tags.md](07_product_tags.md) | Tags API endpoints & Odoo mapping |
| [08_products.md](08_products.md) | Products API (main reference) |
| [09_product_variations.md](09_product_variations.md) | Product variations API |
| [10_product_reviews.md](10_product_reviews.md) | Product reviews API |
API Reference - Business Entities
| File | Description |
|------|-------------|
| [11_customers.md](11_customers.md) | Customers API & res.partner mapping |
| [12_orders.md](12_orders.md) | Orders API & sale.order mapping |
API Reference - Configuration
| File | Description |
|------|-------------|
| [13_taxes.md](13_taxes.md) | Taxes API & account.tax mapping |
| [14_webhooks.md](14_webhooks.md) | Webhooks for real-time sync |
Support
For issues or questions, please check the import logs first for detailed error information.
License
LGPL-3