VNClaw — Odoo 17 Integration Skill
Execution Rules (MUST follow)
- 1. ALWAYS run the command immediately. Never ask the user to confirm or explain what the command does before running it. Translate the request → pick the command → execute it in one step.
- Never say "Would you like me to execute this?" — just execute it.
- Never ask "Do you want me to run this?" — just run it.
- If the command fails, show the error and try to fix it. Do not ask the user for help diagnosing unless you have exhausted all options.
- Credentials: If env vars are missing, inform the user which variable is missing and stop. Do not ask for the value interactively.
Path Resolution
IMPORTANT: All commands below use SKILL_SCRIPTS as shorthand for the absolute path to the scripts directory. The skill may be installed in two locations — resolve it by checking both:
CODEBLOCK0
Possible install locations:
| Location type | Path |
|---|
| Workspace skill | INLINECODE1 |
| User global (vnclaw) |
~/.vnclaw/skills/vnclaw-odoo-skill/scripts/ |
| User global (openclaw) |
~/.openclaw/skills/vnclaw-odoo-skill/scripts/ |
Environment Variables (Required)
Credentials are loaded from environment variables. Never hardcode credentials.
| Variable | Description |
|---|
| INLINECODE4 | Base URL (e.g., https://mycompany.odoo.com) |
| INLINECODE6 |
Database name |
|
ODOO_USERNAME | Login username (email) |
|
ODOO_API_KEY | API key or password |
Common Features (All Modules)
All module scripts share these capabilities:
- -
--my — Filter to current authenticated user's records - Name-based lookups — Use
--user "Alice", --project "Website" etc. instead of IDs - Date shortcuts —
--today, --yesterday, --this-week, --last-week, --this-month, --last-month, INLINECODE18 - Custom date range — INLINECODE19
- Log notes —
log-note action to post internal notes on records (where supported) - Notify —
notify action to schedule activity notifications by user name (where supported) - JSON output — All scripts output JSON to stdout, logs go to stderr
DATE FIELD RULE for tasks.py: Date shortcuts filter date_deadline by default.
To filter by when a task was created, always add --date-field created.
To filter by when a task was last updated, use --date-field updated.
Natural Language → Command Mapping
Use this table to translate common user requests into the correct command:
| User says... | Command |
|---|
| "my tasks" | INLINECODE25 |
| "my tasks this week" / "tasks with deadline this week" |
tasks.py list --my --this-week |
| "tasks I created this week" / "tasks created this week" |
tasks.py list --my --this-week --date-field created |
| "tasks created today" |
tasks.py list --my --today --date-field created |
| "tasks created this month" |
tasks.py list --my --this-month --date-field created |
| "tasks updated today" / "recently modified tasks" |
tasks.py list --my --today --date-field updated |
| "my timesheets this week" |
timesheets.py list --my --this-week |
| "log 2 hours on project X" |
timesheets.py log --project "X" --hours 2 --description "..." |
| "my timesheet summary this month" |
timesheets.py summary --my --this-month |
| "my calendar today" / "my meetings today" |
calendar_events.py list --my --today |
| "my tickets" / "tickets assigned to me" |
helpdesk.py list --my |
| "my leave requests this year" |
time_off.py list --my --this-year |
Quick Decision: Which Script to Use
| User wants to... | Script | Example |
|---|
| List/view/create/update tasks | INLINECODE37 | INLINECODE38 |
| List/view/create/update projects |
projects.py |
python3 $SKILL_SCRIPTS/projects.py list --my |
| Log/view/update
timesheets |
timesheets.py |
python3 $SKILL_SCRIPTS/timesheets.py log --project "Website" --hours 2 --description "review" |
| List/view/create/update
calendar events |
calendar_events.py |
python3 $SKILL_SCRIPTS/calendar_events.py list --my --today |
| List/view/create/update
helpdesk tickets |
helpdesk.py |
python3 $SKILL_SCRIPTS/helpdesk.py list --my --this-week |
| List/view/create/update
time off requests |
time_off.py |
python3 $SKILL_SCRIPTS/time_off.py list --my --this-year |
| List/view/create/update
knowledge articles |
knowledge.py |
python3 $SKILL_SCRIPTS/knowledge.py list --my --published |
| List/view/create/update
documents |
documents.py |
python3 $SKILL_SCRIPTS/documents.py list --folder "HR" |
| Access
any user-defined / custom model |
custom_app.py |
python3 $SKILL_SCRIPTS/custom_app.py list crm.lead --my --this-month |
|
Test connection to Odoo |
odoo_core.py |
python3 $SKILL_SCRIPTS/odoo_core.py test-connection |
Module: Tasks (tasks.py)
Manages project.task. Actions: list, get, create, update, log-note, notify, stages.
Date filter field — use --date-field to choose which date to filter on:
- -
deadline (default) — filters by INLINECODE68 - INLINECODE69 — filters by
create_date (when the task was created) - INLINECODE71 — filters by
write_date (when the task was last modified)
CODEBLOCK1
Module: Projects (projects.py)
Manages project.project. Actions: list, get, create, update, log-note, notify, stages.
CODEBLOCK2
Module: Timesheets (timesheets.py)
Manages account.analytic.line. Actions: list, summary, log, update.
CODEBLOCK3
Module: Calendar Events (calendar_events.py)
Manages calendar.event. Actions: list, get, create, update.
CODEBLOCK4
Module: Helpdesk (helpdesk.py)
Manages helpdesk.ticket. Actions: list, get, create, update, log-note, notify, stages.
CODEBLOCK5
Module: Time Off (time_off.py)
Manages hr.leave. Actions: list, get, create, update, leave-types.
CODEBLOCK6
Module: Knowledge (knowledge.py)
Manages knowledge.article. Actions: list, get, create, update.
CODEBLOCK7
Module: Documents (documents.py)
Manages documents.document. Actions: list, get, create, update, folders.
CODEBLOCK8
Module: Custom App (custom_app.py)
For any Odoo model not covered by the dedicated scripts — CRM, Sales, Purchase, Inventory, Manufacturing, Accounting, or any custom app installed in the Odoo instance.
Recommended workflow:
- 1. Discover the model technical name with INLINECODE124
- Inspect available fields with INLINECODE125
- Then
list, get, create, update as needed
CODEBLOCK9
Generic Client (odoo_core.py)
For raw low-level access or testing the connection:
CODEBLOCK10
Security Rules
- 1. No delete —
unlink is blocked in all scripts. - Sensitive models blocked —
ir.rule, ir.model.access, ir.config_parameter, etc. - Read-only models —
res.users, hr.employee, stage/type models cannot be modified. - Credentials from environment only — Never pass credentials as arguments.
- Audit logging — All operations are logged to stderr with timestamps.
Troubleshooting
| Issue | Solution |
|---|
| INLINECODE137 | Check all 4 env vars: ODOO_URL, ODOO_DB, ODOO_USERNAME, INLINECODE141 |
| INLINECODE142 |
Module may not be installed in your Odoo instance |
|
No module named odoo_core | Run the script from the scripts directory or use absolute path |
| Script not found | Resolve
SKILL_SCRIPTS path as shown in Path Resolution above |
Field Reference
See Odoo Models Reference for detailed field lists per model.
VNClaw — Odoo 17 集成技能
执行规则(必须遵守)
- 1. 始终立即执行命令。 在执行前切勿要求用户确认或解释命令的作用。将请求翻译→选择命令→一步执行。
- 绝不说您希望我执行这个吗? — 直接执行。
- 绝不要问您想让我运行这个吗? — 直接运行。
- 如果命令失败,显示错误并尝试修复。除非已穷尽所有选项,否则不要向用户请求诊断帮助。
- 凭据:如果环境变量缺失,告知用户哪个变量缺失并停止。不要交互式地询问值。
路径解析
重要: 以下所有命令使用 SKILL_SCRIPTS 作为脚本目录绝对路径的简写。该技能可能安装在两个位置 — 通过检查两个位置来解析:
bash
从工作区 (.github/skills/) 或全局 (~/.vscode/extensions/ 或 ~/skills/) 解析 SKILL_SCRIPTS
SKILL_SCRIPTS=$(
# 1. 检查工作区:.github/skills/vnclaw-odoo-skill/scripts
wsroot=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
wspath=$
wsroot/.github/skills/vnclaw-odoo-skill/scripts
# 2. 全局后备位置
globalpath=$HOME/.vnclaw/skills/vnclaw-odoo-skill/scripts
globalpath2=$HOME/.openclaw/skills/vnclaw-odoo-skill/scripts
if [ -d $wspath ]; then
echo $wspath
elif [ -d $globalpath ]; then
echo $globalpath
elif [ -d $globalpath2 ]; then
echo $globalpath2
else
# 最后手段:搜索文件系统
find $HOME /opt -type d -name vnclaw-odoo-skill -path /skills/ 2>/dev/null | head -1 | sed s|$|/scripts|
fi
)
echo SKILLSCRIPTS=$SKILLSCRIPTS
可能的安装位置:
| 位置类型 | 路径 |
|---|
| 工作区技能 | <git-root>/.github/skills/vnclaw-odoo-skill/scripts/ |
| 用户全局 (vnclaw) |
~/.vnclaw/skills/vnclaw-odoo-skill/scripts/ |
| 用户全局 (openclaw) | ~/.openclaw/skills/vnclaw-odoo-skill/scripts/ |
环境变量(必需)
凭据从环境变量加载。切勿硬编码凭据。
| 变量 | 描述 |
|---|
| ODOOURL | 基础 URL(例如 https://mycompany.odoo.com) |
| ODOODB |
数据库名称 |
| ODOO_USERNAME | 登录用户名(邮箱) |
| ODOO
APIKEY | API 密钥或密码 |
通用功能(所有模块)
所有模块脚本共享以下能力:
- - --my — 筛选当前认证用户的记录
- 基于名称的查找 — 使用 --user Alice、--project Website 等代替 ID
- 日期快捷方式 — --today、--yesterday、--this-week、--last-week、--this-month、--last-month、--this-year
- 自定义日期范围 — --date-from 2026-03-01 --date-to 2026-03-31
- 记录备注 — log-note 操作用于在记录上发布内部备注(在支持的地方)
- 通知 — notify 操作用于按用户名安排活动通知(在支持的地方)
- JSON 输出 — 所有脚本输出 JSON 到 stdout,日志输出到 stderr
tasks.py 的日期字段规则:默认情况下,日期快捷方式筛选 date_deadline。
要按任务创建时间筛选,始终添加 --date-field created。
要按任务最后更新时间筛选,使用 --date-field updated。
自然语言 → 命令映射
使用此表将常见用户请求翻译为正确的命令:
| 用户说... | 命令 |
|---|
| 我的任务 | tasks.py list --my |
| 我这周的任务 / 截止日期在本周的任务 |
tasks.py list --my --this-week |
| 我这周创建的任务 / 本周创建的任务 | tasks.py list --my --this-week --date-field created |
| 今天创建的任务 | tasks.py list --my --today --date-field created |
| 本月创建的任务 | tasks.py list --my --this-month --date-field created |
| 今天更新的任务 / 最近修改的任务 | tasks.py list --my --today --date-field updated |
| 我这周的工时表 | timesheets.py list --my --this-week |
| 在项目X上记录2小时 | timesheets.py log --project X --hours 2 --description ... |
| 我这个月的工时表汇总 | timesheets.py summary --my --this-month |
| 我今天的日历 / 我今天的会议 | calendar_events.py list --my --today |
| 我的工单 / 分配给我的工单 | helpdesk.py list --my |
| 我今年的请假申请 | time_off.py list --my --this-year |
快速决策:使用哪个脚本
| 用户想要... | 脚本 | 示例 |
|---|
| 列出/查看/创建/更新任务 | tasks.py | python3 $SKILLSCRIPTS/tasks.py list --my --this-week |
| 列出/查看/创建/更新项目 |
projects.py | python3 $SKILLSCRIPTS/projects.py list --my |
| 记录/查看/更新
工时表 | timesheets.py | python3 $SKILL_SCRIPTS/timesheets.py log --project Website --hours 2 --description review |
| 列出/查看/创建/更新
日历事件 | calendar
events.py | python3 $SKILLSCRIPTS/calendar_events.py list --my --today |
| 列出/查看/创建/更新
帮助台工单 | helpdesk.py | python3 $SKILL_SCRIPTS/helpdesk.py list --my --this-week |
| 列出/查看/创建/更新
请假申请 | time
off.py | python3 $SKILLSCRIPTS/time_off.py list --my --this-year |
| 列出/查看/创建/更新
知识文章 | knowledge.py | python3 $SKILL_SCRIPTS/knowledge.py list --my --published |
| 列出/查看/创建/更新
文档 | documents.py | python3 $SKILL_SCRIPTS/documents.py list --folder HR |
| 访问
任何用户定义/自定义模型 | custom
app.py | python3 $SKILLSCRIPTS/custom_app.py list crm.lead --my --this-month |
|
测试连接到 Odoo | odoo
core.py | python3 $SKILLSCRIPTS/odoo_core.py test-connection |
模块:任务 (tasks.py)
管理 project.task。操作:list、get、create、update、log-note、notify、stages。
日期筛选字段 — 使用 --date-field 选择要筛选的日期:
- - deadline (默认) — 按 datedeadline 筛选
- created — 按 createdate 筛选(任务创建时间)
- updated — 按 write_date 筛选(任务最后修改时间)
bash
我的任务
python3 $SKILL_SCRIPTS/tasks.py list --my
我本周创建的任务 ← created 需要 --date-field created
python3 $SKILL_SCRIPTS/tasks.py list --my --this-week --date-field created
我今天创建的任务
python3 $SKILL_SCRIPTS/tasks.py list --my --today --date-field created
我本月创建的任务
python3 $