odoo-json2-operator
Execute Odoo operations through JSON-2 API endpoints with bearer API keys. Use when the user asks to query or mutate Odoo data (search, read, create, write, unlink, or custom model methods), validate model/method signatures from the api_doc module, or automate step-by-step business actions against an Odoo instance.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- odoo-json2-operator
- description
- Execute Odoo operations through JSON-2 API endpoints with bearer API keys. Use when the user asks to query or mutate Odoo data (search, read, create, write, unlink, or custom model methods), validate model/method signatures from the api_doc module, or automate step-by-step business actions against an Odoo instance.
03 SKILL.md 正文
Odoo JSON-2 Operator
Use this skill to execute Odoo model methods safely via HTTP API.
Use bundled resources
- Read
references/odoo-api-doc-module.mdfor route map and payload conventions based on the localapi_docmodule. - Read
references/api-doc-static-src-learning.mdfor model discovery/search/method payload behavior extracted fromapi_doc/static/src. - Read
references/analysis-playbook.mdwhen user asks for summary analysis, management report, trend interpretation, or decision advice. - Use
scripts/odoo_json2_client.pyto perform deterministic discovery and API calls.
Workflow
- Collect required connection inputs first:
base_url,database,api_key. - Parse user natural-language request into operation intent:
- Infer target business object and map it to likely Odoo model.
- Infer operation type (query/read/create/update/delete/custom action/data analysis).
- Discover and validate the target method:
- Call
/doc-bearer/index.jsonto confirm the model exists. - Call
/doc-bearer/<model>.jsonto confirm method name and parameter hints.
- Call
- Build a minimal payload:
- Read operations first (
search,search_read,read) to verify scope. - For mutating operations, include only required and changed fields.
- Read operations first (
- Execute API call using script:
- Endpoint:
/json/2/<model>/<method> - Method:
POST - Headers: bearer token, JSON content type,
X-Odoo-Database. - Store temporary payload files only under
skills/odoo-json2-operator/.tmp/. - If
--payload-filepoints to atmp_*.jsonfile (or any JSON under--tmp-dir), the client auto-deletes it after execution. - To keep temp payloads for debugging, pass
--keep-tmp-payload-file.
- Endpoint:
- Parse and report result:
- If success, summarize key business outcome.
- If failure, include HTTP status,
message, anddebugdetails when present.
- If user asks for analysis/report:
- Aggregate and compare data by period/segment.
- Produce professional interpretation and decision recommendations in plain Chinese.
Conversation protocol
- Persist successful connections locally as named profiles containing
base_url,database, andapi_key. - Reuse saved profile by default in later turns; do not repeatedly ask for credentials.
- If multiple profiles exist and user does not specify a target system at session start, ask which system/profile to use before proceeding.
- Ask for
base_url,database, andapi_keyonly when no usable profile exists or when user wants a new/updated system. - Accept free-form user text and convert it to
model,method, and payload draft. - Discover models and methods from
/doc-bearer/index.jsonbefore choosing targets. - Use normalized matching for intent mapping (lowercase + strip punctuation) and prioritize exact model/method hits.
- Validate chosen model with
/doc-bearer/<model>.jsonand align payload keys to documented parameters. - If required parameters are missing, ask in plain language and provide concrete examples.
- Explain parameters in business terms, not internal API jargon.
- Confirm assumptions when model mapping is ambiguous.
Analysis output standard
When the task is analysis/reporting, answer with this structure:
结论摘要: 1-3 lines, direct answer first.关键发现: data-backed findings with core numbers.风险与机会: what may worsen and where upside exists.决策建议: 3-5 prioritized actions with expected impact and effort.下一步: missing data to improve confidence and follow-up checks.
Use plain Chinese, avoid dense jargon, and clearly separate facts vs assumptions.
Missing-parameter guidance style
Use short, clear prompts like:
- "我已经知道你要更新客户了,但还差客户ID。请给我一个或多个客户ID,例如
[45]。" - "你要创建销售订单,还缺必填字段
partner_id(客户)和order_line(订单行)。你可以告诉我客户是谁、商品和数量,我来帮你组装。" - "当前只差连接信息:请发我
base_url、database、API Key,我就可以开始执行。" - "要做经营分析还缺时间范围。请告诉我你要看最近7天、30天,还是本月/上月。"
Command templates
python skills/odoo-json2-operator/scripts/odoo_json2_client.py \
--save-profile "odoo-prod" \
--base-url "https://odoo.example.com" \
--database "mydb" \
--api-key "$ODOO_API_KEY"
python skills/odoo-json2-operator/scripts/odoo_json2_client.py --list-profiles
python skills/odoo-json2-operator/scripts/odoo_json2_client.py \
--profile "odoo-prod" \
--discover-index
python skills/odoo-json2-operator/scripts/odoo_json2_client.py \
--profile "odoo-prod" \
--discover-model "res.partner"
python skills/odoo-json2-operator/scripts/odoo_json2_client.py \
--profile "odoo-prod" \
--model "res.partner" \
--method "search_read" \
--payload '{"domain": [["name", "ilike", "Acme"]], "fields": ["name", "email"], "limit": 20}'
python skills/odoo-json2-operator/scripts/odoo_json2_client.py \
--profile "odoo-prod" \
--tmp-dir "skills/odoo-json2-operator/.tmp" \
--model "res.partner" \
--method "search_read" \
--payload-file "skills/odoo-json2-operator/.tmp/tmp_partner_search.json"
Guardrails
- Never guess model/method names when discovery endpoints are available.
- Never run destructive mutations without first showing the matching records unless user explicitly asks to skip preview.
- Never log or persist API keys in files, command history snippets, or chat output.
- Prefer idempotent operations where possible.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.