[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-a8d29d8f-a74b-4a4a-9d8b-adc72c661d50":3,"$faRIjHugctpaXP9AdxgbzHymbGHrKdAGj3bdelEuiIL0":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"a8d29d8f-a74b-4a4a-9d8b-adc72c661d50","odoo-shopify-integration","连接Odoo与Shopify：使用Shopify API和Odoo的外部API或连接器模块同步产品、库存、订单和客户。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: odoo-shopify-integration\ndescription: \"Connect Odoo with Shopify: sync products, inventory, orders, and customers using the Shopify API and Odoo's external API or connector modules.\"\nrisk: unknown\nsource: community\n---\n\n# Odoo ↔ Shopify Integration\n\n## Overview\n\nThis skill guides you through integrating Odoo with Shopify — syncing your product catalog, real-time inventory levels, incoming orders, and customer data. It covers both using the official Odoo Shopify connector (Enterprise) and building a custom integration via Shopify REST + Odoo XMLRPC APIs.\n\n## When to Use This Skill\n\n- Selling on Shopify while managing inventory in Odoo.\n- Automatically creating Odoo sales orders from Shopify purchases.\n- Keeping Odoo stock levels in sync with Shopify product availability.\n- Mapping Shopify product variants to Odoo product templates.\n\n## How It Works\n\n1. **Activate**: Mention `@odoo-shopify-integration` and describe your sync scenario.\n2. **Design**: Receive the data flow architecture and field mapping.\n3. **Build**: Get code snippets for the Shopify webhook receiver and Odoo API caller.\n\n## Data Flow Architecture\n\n```\nSHOPIFY                          ODOO\n--------                         ----\nProduct Catalog \u003C──────sync──────  Product Templates + Variants\nInventory Level \u003C──────sync──────  Stock Quants (real-time)\nNew Order       ───────push──────> Sale Order (auto-confirmed)\nCustomer        ───────push──────> res.partner (created if new)\nFulfillment     \u003C──────push──────  Delivery Order validated\n```\n\n## Examples\n\n### Example 1: Push an Odoo Sale Order for a Shopify Order (Python)\n\n```python\nimport xmlrpc.client, requests\n\n# Odoo connection\nodoo_url = \"https:\u002F\u002Fmyodoo.example.com\"\ndb, uid, pwd = \"my_db\", 2, \"api_key\"\nmodels = xmlrpc.client.ServerProxy(f\"{odoo_url}\u002Fxmlrpc\u002F2\u002Fobject\")\n\ndef create_odoo_order_from_shopify(shopify_order):\n    # Find or create customer\n    partner = models.execute_kw(db, uid, pwd, 'res.partner', 'search_read',\n        [[['email', '=', shopify_order['customer']['email']]]],\n        {'fields': ['id'], 'limit': 1}\n    )\n    partner_id = partner[0]['id'] if partner else models.execute_kw(\n        db, uid, pwd, 'res.partner', 'create', [{\n            'name': shopify_order['customer']['first_name'] + ' ' + shopify_order['customer']['last_name'],\n            'email': shopify_order['customer']['email'],\n        }]\n    )\n\n    # Create Sale Order\n    order_id = models.execute_kw(db, uid, pwd, 'sale.order', 'create', [{\n        'partner_id': partner_id,\n        'client_order_ref': f\"Shopify #{shopify_order['order_number']}\",\n        'order_line': [(0, 0, {\n            'product_id': get_odoo_product_id(line['sku']),\n            'product_uom_qty': line['quantity'],\n            'price_unit': float(line['price']),\n        }) for line in shopify_order['line_items']],\n    }])\n    return order_id\n\ndef get_odoo_product_id(sku):\n    result = models.execute_kw(db, uid, pwd, 'product.product', 'search_read',\n        [[['default_code', '=', sku]]], {'fields': ['id'], 'limit': 1})\n    return result[0]['id'] if result else False\n```\n\n### Example 2: Shopify Webhook for Real-Time Orders\n\n```python\nfrom flask import Flask, request\napp = Flask(__name__)\n\n@app.route('\u002Fwebhook\u002Fshopify\u002Forders', methods=['POST'])\ndef shopify_order_webhook():\n    shopify_order = request.json\n    order_id = create_odoo_order_from_shopify(shopify_order)\n    return {\"odoo_order_id\": order_id}, 200\n```\n\n## Best Practices\n\n- ✅ **Do:** Use Shopify's **webhook system** for real-time order sync instead of polling.\n- ✅ **Do:** Match products using **SKU \u002F Internal Reference** as the unique key between both systems.\n- ✅ **Do:** Validate Shopify webhook HMAC signatures before processing any payload.\n- ❌ **Don't:** Sync inventory from both systems simultaneously without a \"master system\" — pick one as the source of truth.\n- ❌ **Don't:** Use Shopify product IDs as the key — use SKUs which are stable across platforms.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,77,225,"2026-05-16 13:32:31",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"6c264bce-7b43-4a70-96c4-07bec0a37dee","1.0.0","odoo-shopify-integration.zip",2026,"uploads\u002Fskills\u002Fa8d29d8f-a74b-4a4a-9d8b-adc72c661d50\u002Fodoo-shopify-integration.zip","7965c05283b981c76e70fdd0e0e04f65e2eea0ea0be6389b2aa3ffe3fd6d4ae0","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":4423}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]