Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)48k · #5355

odoo-woocommerce-bridge

Skill này làm gì

Công cụ này kết nối cửa hàng trực tuyến (WooCommerce) của bạn với hệ thống quản lý (Odoo). Nó đồng bộ thông tin như sản phẩm, tồn kho, đơn hàng và khách hàng giữa hai hệ thống.

Khi nào nên dùng

  • ✓Khi bạn dùng Odoo để quản lý tồn kho và muốn nó được cập nhật tự động trên cửa hàng WooCommerce.
  • ✓Để đơn hàng đặt trên cửa hàng WooCommerce tự động xuất hiện trong Odoo.
  • ✓Để đảm bảo số lượng tồn kho trong Odoo luôn khớp với những gì hiển thị trên cửa hàng WooCommerce.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-woocommerce-bridge/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-woocommerce-bridge/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Kết nối Odoo với cửa hàng WooCommerce của tôi để đồng bộ sản phẩm và đơn hàng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn chỉ định dữ liệu muốn kết nối (như sản phẩm và đơn hàng). Công cụ sau đó tạo một 'bản đồ' để hai hệ thống hiểu nhau và tạo mã để kết nối này hoạt động.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

WooCommerce Odoo
products product.template + product.product
orders sale.order + sale.order.line
customers res.partner
stock_quantity stock.quant
sku product.product.default_code
order status: processing Sale Order: sale (confirmed)
order status: completed Delivery: done

Examples

Example 1: Pull WooCommerce Orders into Odoo (Python)

from woocommerce import API
import xmlrpc.client
import os

# WooCommerce client
wcapi = API(
    url=os.getenv("WC_URL", "https://mystore.com"),
    consumer_key=os.getenv("WC_KEY"),
    consumer_secret=os.getenv("WC_SECRET"),
    version="wc/v3"
)

# Odoo client
odoo_url = os.getenv("ODOO_URL", "https://myodoo.example.com")
db = os.getenv("ODOO_DB", "my_db")
uid = int(os.getenv("ODOO_UID", "2"))
pwd = os.getenv("ODOO_PASSWORD")
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.

…

Câu hỏi thường gặp

SKU là gì và vì sao quan trọng?

SKU là mã duy nhất cho mỗi sản phẩm. Dùng cùng một SKU trong Odoo và WooCommerce là cách tốt nhất để đảm bảo sản phẩm được nhận diện và đồng bộ đúng giữa hai hệ thống.

Tôi nên đồng bộ tồn kho bao lâu một lần?

Nên đồng bộ tồn kho mỗi 15 đến 30 phút. Đồng bộ quá thường xuyên có thể làm quá tải hệ thống.

Tôi có thể đồng bộ tất cả đơn hàng WooCommerce không?

Không nên. Tốt hơn là chỉ đồng bộ các đơn ở trạng thái 'đang xử lý' hoặc 'đã hoàn thành' để tránh lỗi.

Chi tiết

Mô tả gốc của tác giả

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

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5355
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự