← 返回 Skills 市场
zmtucker

Drivethru Odoo

作者 zmtucker · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
38
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install drivethru-odoo
功能描述
Talk to an Odoo ERP through its `agent_api` REST module — look up eBay products and inventory, push eBay sale orders and read tracking, run the Accounts Paya...
使用说明 (SKILL.md)

Odoo agent_api integration

This skill is a thin, JSON-in / JSON-out wrapper over the Odoo agent_api REST module (/agent_api/v1/*). It authenticates with the X-Agent-API-Key header and covers three domains, one CLI script each:

Script Domain Odoo endpoint prefix
scripts/sales.py eBay sales/inventory /agent_api/v1/ebay/...
scripts/ap.py Accounts Payable /agent_api/v1/ap/...
scripts/production.py MRP scheduling /agent_api/v1/production/...

All three follow the same calling convention:

echo '\x3Cjson-args>' | python3 scripts/\x3Cscript>.py \x3Caction>

The action is the first CLI argument; arguments are a JSON object on stdin. Every script prints a single JSON object on stdout, or {"error": {"type": ..., "message": ...}} with a non-zero exit code on failure.

Required credentials

The agent host MUST expose ODOO_URL and ODOO_API_KEY in the environment before this skill is invoked. If either is missing, the scripts exit with {"error": {"type": "config_error", ...}} (exit code 2) — stop and tell the user to set them. Do not prompt the user to paste the key into chat; secrets come from the environment.

Set ODOO_DRY_RUN=true to preview writes without mutating Odoo.

When to use

  • "What eBay products / inventory do we have in Odoo?"
  • "Push this eBay order into Odoo" / "Is order X shipped — what's the tracking?"
  • "Find the PO for vendor X" / "Create the vendor bill for PO 123"
  • "Show me the production plan" / "Schedule batch 142 onto Manual Press A"

When NOT to use

  • Generic Odoo XML-RPC / ORM access — this skill only speaks the curated agent_api REST surface, not arbitrary models.
  • Editing products, posting bills, or confirming MOs outside the documented actions — do that in the Odoo UI or extend the agent_api addon.

Sales — scripts/sales.py

Action Input (stdin JSON) Notes
list-products (none) Products in the Odoo 'eBay' category.
inventory {"skus": ["A-1", "B-2"]} Stock levels per SKU.
create-order an eBay order object (see mock-order) Idempotent in Odoo; honors dry-run.
tracking {"odoo_order_id": 123} odoo_order_id is numeric, not SO….
mock-order {"sku"?, "buyer_index"?, "num_line_items"?} Offline — generates a test order.

Typical test flow (dry run): generate a mock order, then push it.

python3 scripts/sales.py mock-order \x3C /dev/null \
  | python3 scripts/sales.py create-order

create-order returns {odoo_order_id, odoo_order_name, already_existed, confirmed, confirm_error, ...}. already_existed: true means Odoo already had this eBay order — an idempotent skip, not an error.

Accounts Payable — scripts/ap.py

Action Input (stdin JSON)
search-pos {"search"?, "vendor"?, "state"?, "limit"?}
get-po {"po_id": 123}
update-po-lines {"po_id": 123, "lines": [{"line_id", "price_unit"}], "freight_cost"?, "fees_cost"?}
create-bill {"po_id": 123, "vendor_bill_number"?, "invoice_date"?, "line_ids"?, "reviewer_user_id"?, "review_note"?, "expected_total"?, "tolerance"?}
get-bill {"bill_id": 456}
search-vendors {"search"?, "limit"?}

The AP flow is: find the PO (search-posget-po), correct line prices / freight / fees if needed (update-po-lines), then create-bill. The bill is created in draft; Odoo's create() override auto-adds fee/freight/misc lines, and the reviewer receives an Odoo activity to verify and post it. Pass expected_total + tolerance (default 0.05) to have the server flag mismatches.

Production scheduling (MRP) — scripts/production.py

Action Input (stdin JSON)
overview {"batch_detail"?, "batch_limit"?, "unscheduled_only"?}
list-batches {"unscheduled_only"?, "limit"?, "offset"?}
get-batch {"batch_id": 142}
schedule {"batch_id", "primary_workcenter_id"?, "production_center_id"?, "date_planned_start"?, "date_planned_finished"?, "activity_message"?}
plan {"batch_id": 142}
bulk-schedule {"atomic"?, "updates": [{"batch_id", ...fields}]}
list-workcenters {"active_only"?}
get-workcenter {"workcenter_id": 3}
production-centers (none)
decoration-methods (none)

Start a planning pass with overview (one round-trip: open batches + workcenters with their current load + reference data). Pull get-batch for the batches you intend to place (it returns eligible_workcenters, eligible_production_centers, decoration readiness, and per-MO durations), then write decisions with schedule (single) or bulk-schedule (many).

The four writable scheduling fields are primary_workcenter_id, production_center_id, date_planned_start, date_planned_finished. Partial updates are fine. The server applies them in safe order and auto-derives production_center_id from the workcenter and date_planned_finished from the start unless you set them explicitly. plan runs Odoo's native slot allocator and requires a workcenter to already be set.

Example: schedule one batch

echo '{"batch_id": 142, "primary_workcenter_id": 3,
       "date_planned_start": "2026-06-10T14:00:00",
       "activity_message": "Auto-scheduled by agent"}' \
  | python3 scripts/production.py schedule

Errors

Scripts exit non-zero and print {"error": {...}} on failure:

  • config_error (exit 2) — ODOO_URL / ODOO_API_KEY missing or malformed.
  • api_error — Odoo returned a non-2xx (includes status and body). 401 means a bad ODOO_API_KEY; 404 on get-* means the record doesn't exist.
  • connection_error — Odoo unreachable / timed out.
  • validation_error — bad input JSON or missing required field.
  • unknown_action / usage (exit 2) — bad CLI invocation; the message lists the valid actions.

Surface the human-readable message to the user. Do not retry on config_error, validation_error, or a 401 api_error.

Safety

  • Treat ODOO_API_KEY as a secret — the scripts read it from the environment and never echo it.
  • Use ODOO_DRY_RUN=true until you've confirmed the data mapping. Confirm vendor-bill creation and production schedule writes with the user before running them against a live (non-dry-run) Odoo.

References

安全使用建议
Install only if you intend to let the agent access your Odoo ERP through the provided agent_api key. Use ODOO_DRY_RUN=true for initial testing, keep the API key out of chat, and confirm live write actions such as order creation, PO line updates, vendor bill creation, and production scheduling before running them.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The stated purpose matches the implementation: sales, accounts payable, and production scheduling actions map to documented /agent_api/v1 Odoo endpoints.
Instruction Scope
Runtime instructions are scoped to specific CLI actions and curated REST endpoints, with explicit guidance not to use arbitrary Odoo ORM/XML-RPC access.
Install Mechanism
Install metadata only declares python3, ODOO_URL, ODOO_API_KEY, and the requests dependency; no hidden install-time commands or persistence were found.
Credentials
The skill requires a sensitive Odoo API key and can mutate business records, but that access is disclosed, purpose-aligned, and limited to the configured Odoo instance.
Persistence & Privilege
No background workers, local persistence, privilege escalation, credential harvesting, or broad filesystem access were identified; credentials are read from environment variables and sent only as the documented Odoo API header.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install drivethru-odoo
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /drivethru-odoo 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of drivethru-odoo: a skill to interact with Odoo ERP for eBay fulfillment, AP flow, and MRP scheduling. - Connects to Odoo's agent_api REST module using environment-based API key authentication. - Three domains supported: eBay sales/inventory, Accounts Payable (vendor bill flow), and Production (MRP) scheduling, each via a dedicated script. - Actions include product/inventory lookup, eBay order push, vendor bill creation, production batch scheduling, and more. - Supports dry-run mode to preview write actions without affecting Odoo data. - Requires ODOO_URL and ODOO_API_KEY to be set in the environment.
元数据
Slug drivethru-odoo
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Drivethru Odoo 是什么?

Talk to an Odoo ERP through its `agent_api` REST module — look up eBay products and inventory, push eBay sale orders and read tracking, run the Accounts Paya... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 38 次。

如何安装 Drivethru Odoo?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install drivethru-odoo」即可一键安装,无需额外配置。

Drivethru Odoo 是免费的吗?

是的,Drivethru Odoo 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Drivethru Odoo 支持哪些平台?

Drivethru Odoo 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Drivethru Odoo?

由 zmtucker(@zmtucker)开发并维护,当前版本 v0.1.0。

💬 留言讨论