odoo-woocommerce-bridge

Sync Odoo with WooCommerce: products, inventory, orders, and customers via WooCommerce REST API and Odoo external API.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "odoo-woocommerce-bridge" with this command: npx skills add sickn33/antigravity-awesome-skills/sickn33-antigravity-awesome-skills-odoo-woocommerce-bridge

Odoo ↔ WooCommerce Bridge

Overview

This skill guides you through building a reliable sync bridge between Odoo (the back-office ERP) and WooCommerce (the WordPress online store). It covers product catalog sync, real-time inventory updates, order import, and customer record management.

When to Use This Skill

  • Running a WooCommerce store with Odoo for inventory and fulfillment.
  • Automatically pulling WooCommerce orders into Odoo as sale orders.
  • Keeping WooCommerce product stock in sync with Odoo's warehouse.
  • Mapping WooCommerce order statuses to Odoo delivery states.

How It Works

  1. Activate: Mention @odoo-woocommerce-bridge and describe your sync requirements.
  2. Design: Get the field mapping table between WooCommerce and Odoo objects.
  3. Build: Receive Python integration scripts using the WooCommerce REST API.

Field Mapping: WooCommerce → Odoo

WooCommerceOdoo
productsproduct.template + product.product
orderssale.order + sale.order.line
customersres.partner
stock_quantitystock.quant
skuproduct.product.default_code
order status: processingSale Order: sale (confirmed)
order status: completedDelivery: done

Examples

Example 1: Pull WooCommerce Orders into Odoo (Python)

from woocommerce import API
import xmlrpc.client

# WooCommerce client
wcapi = API(
    url="https://mystore.com",
    consumer_key="ck_xxxxxxxxxxxxx",
    consumer_secret="cs_xxxxxxxxxxxxx",
    version="wc/v3"
)

# Odoo client
odoo_url = "https://myodoo.example.com"
db, uid, pwd = "my_db", 2, "api_key"
models = xmlrpc.client.ServerProxy(f"{odoo_url}/xmlrpc/2/object")

def sync_orders():
    # Get unprocessed WooCommerce orders
    orders = wcapi.get("orders", params={"status": "processing", "per_page": 50}).json()

    for wc_order in orders:
        # Find or create Odoo partner
        email = wc_order['billing']['email']
        partner = models.execute_kw(db, uid, pwd, 'res.partner', 'search',
            [[['email', '=', email]]])
        if not partner:
            partner_id = models.execute_kw(db, uid, pwd, 'res.partner', 'create', [{
                'name': f"{wc_order['billing']['first_name']} {wc_order['billing']['last_name']}",
                'email': email,
                'phone': wc_order['billing']['phone'],
                'street': wc_order['billing']['address_1'],
                'city': wc_order['billing']['city'],
            }])
        else:
            partner_id = partner[0]

        # Create Sale Order in Odoo
        order_lines = []
        for item in wc_order['line_items']:
            product = models.execute_kw(db, uid, pwd, 'product.product', 'search',
                [[['default_code', '=', item['sku']]]])
            if product:
                order_lines.append((0, 0, {
                    'product_id': product[0],
                    'product_uom_qty': item['quantity'],
                    'price_unit': float(item['price']),
                }))

        models.execute_kw(db, uid, pwd, 'sale.order', 'create', [{
            'partner_id': partner_id,
            'client_order_ref': f"WC-{wc_order['number']}",
            'order_line': order_lines,
        }])

        # Mark WooCommerce order as on-hold (processed by Odoo)
        wcapi.put(f"orders/{wc_order['id']}", {"status": "on-hold"})

Example 2: Push Odoo Stock to WooCommerce

def sync_inventory_to_woocommerce():
    # Get all products with a SKU from Odoo
    products = models.execute_kw(db, uid, pwd, 'product.product', 'search_read',
        [[['default_code', '!=', False], ['type', '=', 'product']]],
        {'fields': ['default_code', 'qty_available']}
    )

    for product in products:
        sku = product['default_code']
        qty = int(product['qty_available'])

        # Update WooCommerce by SKU
        wc_products = wcapi.get("products", params={"sku": sku}).json()
        if wc_products:
            wcapi.put(f"products/{wc_products[0]['id']}", {
                "stock_quantity": qty,
                "manage_stock": True,
            })

Best Practices

  • Do: Use SKU as the unique identifier linking WooCommerce products to Odoo products.
  • Do: Run inventory sync on a schedule (every 15-30 min) rather than real-time to avoid rate limits.
  • Do: Log all API calls and errors to a database table for debugging.
  • Don't: Process the same WooCommerce order twice — flag it as processed immediately after import.
  • Don't: Sync draft or cancelled WooCommerce orders to Odoo — filter by status = processing or completed.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

docker-expert

No summary provided by upstream source.

Repository SourceNeeds Review
General

nextjs-supabase-auth

No summary provided by upstream source.

Repository SourceNeeds Review
3.2K-sickn33
General

nextjs-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
3.1K-sickn33
General

prisma-expert

No summary provided by upstream source.

Repository SourceNeeds Review
2.7K-sickn33