odoo

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/odoo

/odoo

Odoo ERP integration via
@marcfargas/odoo-client
. Connect, query, and automate.
通过
@marcfargas/odoo-client
实现Odoo ERP集成。连接、查询并自动化操作。

Quick Start

快速开始

typescript
import { createClient } from '@marcfargas/odoo-client';

const client = await createClient();  // reads ODOO_URL, ODOO_DB, ODOO_USER, ODOO_PASSWORD

// Core CRUD — directly on client
const partners = await client.searchRead('res.partner', [['is_company', '=', true]], {
  fields: ['name', 'email'],
  limit: 10,
});

// Chatter — via client.mail service accessor
await client.mail.postInternalNote('crm.lead', 42, '<p>Called customer.</p>');
await client.mail.postOpenMessage('res.partner', 7, 'Order shipped.');

// Module management — via client.modules accessor
if (await client.modules.isModuleInstalled('sale')) { /* ... */ }
typescript
import { createClient } from '@marcfargas/odoo-client';

const client = await createClient();  // 读取ODOO_URL、ODOO_DB、ODOO_USER、ODOO_PASSWORD环境变量

// 核心CRUD操作 — 直接通过客户端执行
const partners = await client.searchRead('res.partner', [['is_company', '=', true]], {
  fields: ['name', 'email'],
  limit: 10,
});

// 消息框(Chatter) — 通过client.mail服务访问器
await client.mail.postInternalNote('crm.lead', 42, '<p>已致电客户。</p>');
await client.mail.postOpenMessage('res.partner', 7, '订单已发货。');

// 模块管理 — 通过client.modules访问器
if (await client.modules.isModuleInstalled('sale')) { /* ... */ }

Service Accessors

服务访问器

Domain-specific helpers are accessed via lazy getters on the client:
AccessorDescriptionSkill doc
client.mail.*
Post notes & messages on chatter
mail/chatter.md
client.modules.*
Install, uninstall, check modules
base/modules.md
client.attendance.*
Clock in/out, presence tracking
modules/attendance.md
client.timesheets.*
Timer start/stop, time logging
modules/timesheets.md
Core CRUD (
searchRead
,
create
,
write
,
unlink
, etc.) stays directly on
client
.
领域特定的辅助工具可通过客户端的延迟获取器访问:
访问器描述Skill文档
client.mail.*
在消息框中发布笔记和消息
mail/chatter.md
client.modules.*
安装、卸载、检查模块
base/modules.md
client.attendance.*
签到/签退、出勤追踪
modules/attendance.md
client.timesheets.*
计时器启动/停止、工时记录
modules/timesheets.md
核心CRUD操作(
searchRead
create
write
unlink
等)直接通过
client
执行。

Prerequisites (Must Read First)

前置条件(必读)

Before any Odoo operation, load these foundational modules:
  1. base/connection.md
    createClient()
    , authentication, environment variables
  2. base/field-types.md
    — Odoo type system (read/write asymmetry)
  3. base/domains.md
    — Query filter syntax
在执行任何Odoo操作前,请加载以下基础模块:
  1. base/connection.md
    createClient()
    、身份验证、环境变量
  2. base/field-types.md
    — Odoo类型系统(读写不对称性)
  3. base/domains.md
    — 查询过滤语法

Additional Modules

额外模块

Load as needed by reading
base/{name}.md
:
ModuleDescription
introspectionDiscover models & fields
crudCreate, read, update, delete patterns
searchSearch & filtering patterns
propertiesDynamic user-defined fields
modulesModule lifecycle management
skill-generationHow to create new skills
按需加载,请阅读
base/{name}.md
模块描述
introspection探查模型和字段
crud增删改查(CRUD)模式
search搜索与过滤模式
properties动态用户定义字段
modules模块生命周期管理
skill-generation如何创建新Skill

Mail & Messaging

邮件与消息

Skills for Odoo's mail system. Load by reading
mail/{name}.md
:
ModuleDescription
chatterPost messages and notes on records (
client.mail.*
)
activitiesSchedule and manage activities/tasks
discussChat channels and direct messages
Note: The
mail
module is part of base Odoo and is typically always installed.
适用于Odoo邮件系统的Skill。请阅读
mail/{name}.md
进行加载:
模块描述
chatter在记录上发布消息和笔记(
client.mail.*
activities安排和管理活动/任务
discuss聊天频道和直接消息
注意:
mail
模块是Odoo基础模块的一部分,通常默认已安装。

Version-Specific Notes

版本特定说明

Breaking changes between Odoo versions are documented in
CHANGES_V{XX}.md
:
DocumentVersionKey Changes
CHANGES_V17.md
Odoo 17mail.channel → discuss.channel, read tracking
Odoo版本间的破坏性变更记录在
CHANGES_V{XX}.md
中:
文档版本主要变更
CHANGES_V17.md
Odoo 17mail.channel → discuss.channel、阅读追踪

Module-Specific Skills

特定模块Skill

Skills that require specific Odoo modules to be installed. Before loading, verify the required modules are present using
client.modules.isModuleInstalled()
.
Load by reading the path shown below:
SkillPathRequired ModulesDescription
accounting
modules/accounting.md
account
Accounting patterns, cashflow, reconciliation, bank statements
attendance
modules/attendance.md
hr_attendance
Clock in/out, presence tracking (
client.attendance.*
)
timesheets
modules/timesheets.md
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, expression language, styling
需要安装特定Odoo模块才能使用的Skill。加载前,请使用
client.modules.isModuleInstalled()
验证所需模块是否已安装。
请通过下方所示路径加载:
Skill路径所需模块描述
accounting
modules/accounting.md
account
会计模式、现金流、对账、银行对账单
attendance
modules/attendance.md
hr_attendance
签到/签退、出勤追踪(
client.attendance.*
timesheets
modules/timesheets.md
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 — 创建和编辑报表模板、表达式语言、样式设置

Skill Generation Workflow

Skill生成流程

  1. Read
    base/introspection.md
  2. Introspect target model schema
  3. Create
    skills/{model-action}.md
    following the format in
    base/skill-generation.md
  4. Update this SKILL.md to reference the new skill
  1. 阅读
    base/introspection.md
  2. 探查目标模型架构
  3. 遵循
    base/skill-generation.md
    中的格式创建
    skills/{model-action}.md
  4. 更新本SKILL.md以引用新Skill