odoo by marcfargas/odoo-toolbox
npx skills add https://github.com/marcfargas/odoo-toolbox --skill odooOdoo ERP 集成。两种工作方式:CLI(适用于大多数任务的最快方式)和库(适用于脚本和自动化)。
odoo CLI 允许您搜索、创建、更新和删除记录,无需编写任何代码。
# 1. 验证连接(始终首先执行此操作)
odoo config check
# 2. 搜索记录
odoo records search res.partner --fields name,email --limit 5
# 3. 创建记录
odoo records create res.partner --data '{"name":"Acme Corp"}' --confirm
# 4. 在记录上发布备注
odoo mail note crm.lead 42 "Called customer" --confirm
import { createClient } from '@marcfargas/odoo-client';
const client = await createClient(); // 读取 ODOO_URL, ODOO_DB, ODOO_USER, ODOO_PASSWORD
const partners = await client.searchRead('res.partner', [['is_company', '=', true]], {
fields: ['name', 'email'],
limit: 10,
});
await client.mail.postInternalNote('crm.lead', 42, '<p>Called customer.</p>');
await client.modules.isModuleInstalled('sale');
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
export ODOO_URL=https://mycompany.odoo.com
export ODOO_DB=mycompany
export ODOO_USER=admin
export ODOO_PASSWORD=yourpassword
odoo config check
# ✓ 已连接到 https://mycompany.odoo.com (数据库: mycompany)
# 用户: Administrator (admin) [id: 2]
# 已安装模块: 143
# 搜索记录
odoo records search res.partner --fields name,email --limit 10
# 内省模式
odoo schema fields crm.lead --type many2one
# 检查已安装模块
odoo modules list --filter installed --search sale
所有 odoo CLI 命令都使用以下标准退出代码:
| 代码 | 含义 |
|---|---|
0 | 成功 |
1 | 用法错误(错误的标志、缺少 --confirm、无效参数) |
2 | 身份验证/网络错误(凭据错误、Odoo 无法访问) |
3 | 未找到 |
4 | 权限被拒绝 |
5 | 验证错误(Odoo 拒绝了值) |
6 | 冲突(例如,已打卡上班) |
10 | 部分成功 |
在脚本中使用:
odoo records get crm.lead 42 || echo "Exit code: $?"
| CLI 命令 | 技能文档 | 描述 |
|---|---|---|
odoo config check/show | cli/config.md | 验证连接,显示已解析的配置 |
odoo records search/get/create/write/delete/count/call | cli/records.md | 对任何模型的通用 CRUD 操作 |
odoo schema models/fields/describe/codegen | base/introspection.md | 发现模型和字段 |
odoo modules list/install/uninstall/upgrade/info/status | base/modules.md | 管理 Odoo 模块 |
odoo url record/portal | base/urls.md | 生成版本无关的记录 URL |
odoo mail note/post | mail/chatter.md | 在 chatter 上发布备注和消息 |
odoo attendance clock-in/clock-out/status/list | modules/attendance.md | 员工打卡上班/下班 |
odoo timesheets start/stop/running/log/list | modules/timesheets.md | 时间跟踪 |
odoo accounting cash-accounts/cash-balance/posted-moves/trace-recon/days-to-pay | modules/accounting.md | 只读会计查询 |
odoo state plan/apply/diff ⚠ | cli/state.md | 实验性:状态管理 |
特定领域的助手通过客户端上的惰性获取器访问:
| 访问器 | CLI 命令 | 描述 | 技能文档 |
|---|---|---|---|
client.mail.* | odoo mail | 在 chatter 上发布备注和消息 | mail/chatter.md |
client.modules.* | odoo modules | 安装、卸载、检查模块 | base/modules.md |
client.urls.* | odoo url | 生成版本无关的记录 URL | base/urls.md |
client.properties.* | — | 属性字段的安全操作 | base/properties.md |
client.cdc.* | — | 变更数据捕获 — 通过 mail.tracking.value 获取字段变更历史 | modules/cdc.md |
client.accounting.* | odoo accounting | 现金发现、对账、合作伙伴解析 | modules/accounting.md |
client.attendance.* | odoo attendance | 打卡上班/下班、出勤跟踪 | modules/attendance.md |
client.timesheets.* | odoo timesheets | 计时器启动/停止、时间记录 | modules/timesheets.md |
核心 CRUD 操作(searchRead、create、write、unlink 等)直接保留在 client 上。
| 操作 | 级别 | 备注 |
|---|---|---|
client.search(), searchRead(), read(), searchCount() | 读取 | |
client.create() | 写入 | |
client.write() | 写入 | |
client.unlink() | 破坏性 | 永久删除 |
client.call() | 可变 | 取决于方法 — 请查看每个技能的文档 |
client.mail.postInternalNote() | 写入 | 仅内部使用,不发送电子邮件 |
client.mail.postOpenMessage() | 破坏性 | 向关注者发送电子邮件(可能包含外部人员) |
client.modules.isModuleInstalled() | 读取 | |
client.modules.installModule() | 破坏性 | 模式变更,难以回滚 |
client.modules.uninstallModule() | 破坏性 | 删除模块数据,不可逆 |
client.properties.* | 写入 | 安全的属性更新,防止数据丢失 |
client.accounting.* | 读取 | 所有会计助手均为只读 |
client.timesheets.logTime(), startTimer(), stopTimer() | 写入 | |
client.attendance.* | 写入 | 打卡上班/下班 |
client.urls.* | 读取 | 纯 URL 构造,无 RPC 调用 |
在任何 Odoo 操作之前,请加载以下基础模块:
base/connection.md — createClient()、身份验证、环境变量base/field-types.md — Odoo 类型系统(读/写不对称性)base/domains.md — 查询过滤器语法根据需要加载,通过阅读 base/{name}.md:
| 模块 | CLI 覆盖 | 描述 |
|---|---|---|
| introspection | odoo schema | 发现模型和字段 |
| crud | odoo records | 创建、读取、更新、删除模式 |
| search | odoo records search | 搜索和过滤模式 |
| properties | — | 动态用户定义字段 |
| modules | odoo modules | 模块生命周期管理 |
| urls | odoo url | 版本无关的记录 URL 生成 |
| multi-company | odoo records search --context | 多公司上下文、allowed_company_ids、常见问题 |
| translations | — | 读取和写入字段翻译(Odoo 17+,ir.translation 已移除) |
| context-keys | --context 标志 | 邮件/chatter 上下文键:tracking_disable、mail_notrack、mail_create_nolog 等 |
用于 Odoo 邮件系统的技能。通过阅读 mail/{name}.md 加载:
| 模块 | CLI 覆盖 | 描述 |
|---|---|---|
| chatter | odoo mail | 在记录上发布消息和备注(client.mail.*) |
| activities | — | 安排和管理活动/任务 |
| discuss | — | 聊天频道和直接消息 |
注意: mail 模块是 Odoo 基础的一部分,通常始终安装。
需要特定 Odoo 模块已安装的技能。加载前,请验证所需模块是否存在。
# CLI: 检查模块是否已安装
odoo modules status hr_attendance
// 库: 检查模块是否已安装
await client.modules.isModuleInstalled('hr_attendance')
通过阅读下面显示的路径加载:
| 技能 | 路径 | CLI 命令 | 必需模块 | 描述 |
|---|---|---|---|---|
| accounting | modules/accounting.md | odoo accounting | account | 会计模式、现金流、对账、损益、验证 |
| contracts | modules/contracts.md | — | contract (OCA) | 周期性合同、计费计划、收入预测 |
| attendance | modules/attendance.md | odoo attendance | hr_attendance | 打卡上班/下班、出勤跟踪(client.attendance.*) |
| timesheets | modules/timesheets.md | odoo timesheets | hr_timesheet | 计时器启动/停止、项目时间记录(client.timesheets.*) |
| mis-builder | oca/mis-builder.md | — | mis_builder, date_range, report_xlsx | MIS Builder — 读取、计算、导出报告 |
| mis-builder-dev | oca/mis-builder-dev.md | — | mis_builder, date_range, report_xlsx | MIS Builder — 创建和编辑报告模板 |
| product-configurator | modules/product-configurator.md | — | sale_product_configurator | 销售行上的产品属性和变体 — no_variant、price_extra、自定义值 |
每周安装数
82
代码仓库
GitHub 星标数
25
首次出现
2026年2月11日
安全审计
安装于
codex77
github-copilot76
amp76
kimi-cli76
gemini-cli76
opencode76
Odoo ERP integration. Two ways to work: CLI (fastest for most tasks) and Library (for scripts and automation).
The odoo CLI lets you search, create, update, and delete records without writing any code.
# 1. Verify connection (always do this first)
odoo config check
# 2. Search records
odoo records search res.partner --fields name,email --limit 5
# 3. Create a record
odoo records create res.partner --data '{"name":"Acme Corp"}' --confirm
# 4. Post a note on a record
odoo mail note crm.lead 42 "Called customer" --confirm
import { createClient } from '@marcfargas/odoo-client';
const client = await createClient(); // reads ODOO_URL, ODOO_DB, ODOO_USER, ODOO_PASSWORD
const partners = await client.searchRead('res.partner', [['is_company', '=', true]], {
fields: ['name', 'email'],
limit: 10,
});
await client.mail.postInternalNote('crm.lead', 42, '<p>Called customer.</p>');
await client.modules.isModuleInstalled('sale');
export ODOO_URL=https://mycompany.odoo.com
export ODOO_DB=mycompany
export ODOO_USER=admin
export ODOO_PASSWORD=yourpassword
odoo config check
# ✓ Connected to https://mycompany.odoo.com (db: mycompany)
# User: Administrator (admin) [id: 2]
# Installed modules: 143
# Search for records
odoo records search res.partner --fields name,email --limit 10
# Introspect schema
odoo schema fields crm.lead --type many2one
# Check installed modules
odoo modules list --filter installed --search sale
All odoo CLI commands use these standard exit codes:
| Code | Meaning |
|---|---|
0 | Success |
1 | Usage error (bad flags, missing --confirm, invalid arguments) |
2 | Auth / network error (wrong credentials, Odoo unreachable) |
3 | Not found |
4 | Permission denied |
5 |
Use in scripts:
odoo records get crm.lead 42 || echo "Exit code: $?"
| CLI Command | Skill Doc | Description |
|---|---|---|
odoo config check/show | cli/config.md | Verify connection, show resolved config |
odoo records search/get/create/write/delete/count/call | cli/records.md | Generic CRUD on any model |
odoo schema models/fields/describe/codegen | base/introspection.md | Discover models and fields |
Domain-specific helpers are accessed via lazy getters on the client:
| Accessor | CLI Command | Description | Skill doc |
|---|---|---|---|
client.mail.* | odoo mail | Post notes & messages on chatter | mail/chatter.md |
client.modules.* | odoo modules | Install, uninstall, check modules | base/modules.md |
client.urls.* |
Core CRUD (searchRead, create, write, unlink, etc.) stays directly on client.
| Operation | Level | Notes |
|---|---|---|
client.search(), searchRead(), read(), searchCount() | READ | |
client.create() | WRITE | |
client.write() | WRITE | |
client.unlink() |
Before any Odoo operation, load these foundational modules:
base/connection.md — createClient(), authentication, environment variablesbase/field-types.md — Odoo type system (read/write asymmetry)base/domains.md — Query filter syntaxLoad as needed by reading base/{name}.md:
| Module | CLI Coverage | Description |
|---|---|---|
| introspection | odoo schema | Discover models & fields |
| crud | odoo records | Create, read, update, delete patterns |
| search | odoo records search | Search & filtering patterns |
| properties | — | Dynamic user-defined fields |
| modules | odoo modules | Module lifecycle management |
| urls |
Skills for Odoo's mail system. Load by reading mail/{name}.md:
| Module | CLI Coverage | Description |
|---|---|---|
| chatter | odoo mail | Post messages and notes on records (client.mail.*) |
| activities | — | Schedule and manage activities/tasks |
| discuss | — | Chat channels and direct messages |
Note: The mail module is part of base Odoo and is typically always installed.
Skills that require specific Odoo modules to be installed. Before loading, verify the required modules are present.
# CLI: check a module is installed
odoo modules status hr_attendance
// Library: check a module is installed
await client.modules.isModuleInstalled('hr_attendance')
Load by reading the path shown below:
| Skill | Path | CLI Command | Required Modules | Description |
|---|---|---|---|---|
| accounting | modules/accounting.md | odoo accounting | account | Accounting patterns, cashflow, reconciliation, PnL, validation |
| contracts | modules/contracts.md | — | contract (OCA) | Recurring contracts, billing schedules, revenue projection |
| attendance |
Weekly Installs
82
Repository
GitHub Stars
25
First Seen
Feb 11, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex77
github-copilot76
amp76
kimi-cli76
gemini-cli76
opencode76
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
44,900 周安装
| Validation error (Odoo rejected the values) |
6 | Conflict (e.g., already clocked in) |
10 | Partial success |
odoo modules list/install/uninstall/upgrade/info/status | base/modules.md | Manage Odoo modules |
odoo url record/portal | base/urls.md | Generate version-agnostic record URLs |
odoo mail note/post | mail/chatter.md | Post notes and messages on chatters |
odoo attendance clock-in/clock-out/status/list | modules/attendance.md | Employee clock in/out |
odoo timesheets start/stop/running/log/list | modules/timesheets.md | Time tracking |
odoo accounting cash-accounts/cash-balance/posted-moves/trace-recon/days-to-pay | modules/accounting.md | Read-only accounting queries |
odoo state plan/apply/diff ⚠ | cli/state.md | Experimental: state management |
odoo url |
| Generate version-agnostic record URLs |
base/urls.md |
client.properties.* | — | Safe operations for properties fields | base/properties.md |
client.cdc.* | — | Change Data Capture — field change history via mail.tracking.value | modules/cdc.md |
client.accounting.* | odoo accounting | Cash discovery, reconciliation, partner resolution | modules/accounting.md |
client.attendance.* | odoo attendance | Clock in/out, presence tracking | modules/attendance.md |
client.timesheets.* | odoo timesheets | Timer start/stop, time logging | modules/timesheets.md |
| DESTRUCTIVE |
| Permanent deletion |
client.call() | VARIES | Depends on method — check per-skill docs |
client.mail.postInternalNote() | WRITE | Internal only, no emails sent |
client.mail.postOpenMessage() | DESTRUCTIVE | Sends email to followers (may be external) |
client.modules.isModuleInstalled() | READ |
client.modules.installModule() | DESTRUCTIVE | Schema change, hard to rollback |
client.modules.uninstallModule() | DESTRUCTIVE | Deletes module data, irreversible |
client.properties.* | WRITE | Safe property updates, prevents data loss |
client.accounting.* | READ | All accounting helpers are read-only |
client.timesheets.logTime(), startTimer(), stopTimer() | WRITE |
client.attendance.* | WRITE | Clock in/out |
client.urls.* | READ | Pure URL construction, no RPC |
odoo url| Version-agnostic record URL generation |
| multi-company | odoo records search --context | Multi-company context, allowed_company_ids, common gotchas |
| translations | — | Read and write field translations (Odoo 17+, ir.translation removed) |
| context-keys | --context flag | Mail/chatter context keys: tracking_disable, mail_notrack, mail_create_nolog, etc. |
modules/attendance.md |
odoo attendance |
hr_attendance |
Clock in/out, presence tracking (client.attendance.*) |
| timesheets | modules/timesheets.md | odoo timesheets | hr_timesheet | Timer start/stop, time logging on projects (client.timesheets.*) |
| mis-builder | oca/mis-builder.md | — | mis_builder, date_range, report_xlsx | MIS Builder — reading, computing, exporting reports |
| mis-builder-dev | oca/mis-builder-dev.md | — | mis_builder, date_range, report_xlsx | MIS Builder — creating & editing report templates |
| product-configurator | modules/product-configurator.md | — | sale_product_configurator | Product attributes & variants on sale lines — no_variant, price_extra, custom values |