odoo-18
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOdoo 18 Skill - Master Index
Odoo 18 技能 - 总索引
Master index for all Odoo 18 guides. Use this to quickly find the appropriate guide for your task.
所有Odoo 18指南的总索引。使用本索引可快速找到适合你任务的指南。
Quick Reference
快速参考
| Topic | File | When to Use |
|---|---|---|
| Actions | | Creating actions, menus, scheduled jobs, server actions |
| API Decorators | | Using @api decorators, compute fields, validation |
| Data Files | | XML/CSV data files, records, shortcuts |
| Development | | Creating modules, manifest, reports, security, wizards |
| Field Types | | Defining model fields, choosing field types |
| Manifest | | manifest.py configuration, dependencies, hooks |
| Mixins | | mail.thread, activities, email aliases, tracking |
| Model Methods | | Writing ORM queries, CRUD operations, domain filters |
| Performance | | Optimizing queries, fixing slow code, preventing N+1 |
| Reports | | QWeb reports, PDF/HTML, templates, paper formats |
| Security | | Access rights, record rules, field permissions |
| Testing | | Writing tests, mocking, assertions, browser testing |
| Translation | | Adding translations, localization, i18n |
| Transactions | | Handling database errors, savepoints, UniqueViolation |
| Controllers | | Writing HTTP endpoints, routes, web controllers |
| Views & XML | | Writing XML views, actions, menus, QWeb templates |
| OWL Components | | Building OWL UI components, hooks, services |
| Migration | | Upgrading modules, data migration, version changes |
| 主题 | 文件 | 使用场景 |
|---|---|---|
| 动作 | | 创建动作、菜单、定时任务、服务器动作 |
| API装饰器 | | 使用@api装饰器、计算字段、验证 |
| 数据文件 | | XML/CSV数据文件、记录、快捷方式 |
| 开发 | | 创建模块、清单、报表、安全配置、向导 |
| 字段类型 | | 定义模型字段、选择字段类型 |
| 清单 | | manifest.py配置、依赖、钩子 |
| 混合类 | | mail.thread、活动、邮箱别名、追踪 |
| 模型方法 | | 编写ORM查询、CRUD操作、域过滤器 |
| 性能 | | 优化查询、修复慢代码、避免N+1问题 |
| 报表 | | QWeb报表、PDF/HTML、模板、纸张格式 |
| 安全 | | 访问权限、记录规则、字段权限 |
| 测试 | | 编写测试、模拟、断言、浏览器测试 |
| 翻译 | | 添加翻译、本地化、i18n |
| 事务 | | 处理数据库错误、保存点、UniqueViolation |
| 控制器 | | 编写HTTP端点、路由、Web控制器 |
| 视图与XML | | 编写XML视图、动作、菜单、QWeb模板 |
| OWL组件 | | 构建OWL UI组件、钩子、服务 |
| 迁移 | | 升级模块、数据迁移、版本变更 |
Guide Index
指南索引
Actions Guide
动作指南
File:
odoo-18-actions-guide.mdWhen to read:
- Creating window actions, URL actions, server actions
- Setting up scheduled/cron jobs
- Configuring report actions
- Creating client-side actions
- Understanding action bindings
文件:
odoo-18-actions-guide.md阅读场景:
- 创建窗口动作、URL动作、服务器动作
- 设置定时/ cron任务
- 配置报表动作
- 创建客户端动作
- 理解动作绑定
Controller Guide
控制器指南
File:
odoo-18-controller-guide.mdWhen to read:
- Creating HTTP endpoints
- Writing web controllers
- Setting up routes
- Choosing auth types (user, public, none)
- Handling JSON vs HTTP responses
文件:
odoo-18-controller-guide.md阅读场景:
- 创建HTTP端点
- 编写Web控制器
- 设置路由
- 选择认证类型(user、public、none)
- 处理JSON与HTTP响应
Data Files Guide
数据文件指南
File:
odoo-18-data-guide.mdWhen to read:
- Creating XML data files
- Understanding record, field, delete, function tags
- Using CSV data files
- Working with shortcuts (menuitem, template, asset)
- Understanding noupdate attribute
文件:
odoo-18-data-guide.md阅读场景:
- 创建XML数据文件
- 理解record、field、delete、function标签
- 使用CSV数据文件
- 处理快捷方式(menuitem、template、asset)
- 理解noupdate属性
Decorator Guide
装饰器指南
File:
odoo-18-decorator-guide.mdWhen to read:
- Using for computed fields
@api.depends - Using for validation
@api.constrains - Using (Odoo 18) for delete validation
@api.ondelete - Using for form UI updates
@api.onchange - Using for model-level methods
@api.model
文件:
odoo-18-decorator-guide.md阅读场景:
- 使用定义计算字段
@api.depends - 使用进行验证
@api.constrains - 使用(Odoo 18)进行删除验证
@api.ondelete - 使用更新表单UI
@api.onchange - 使用定义模型级方法
@api.model
Development Guide
开发指南
File:
odoo-18-development-guide.mdWhen to read:
- Creating new modules
- Writing
__manifest__.py - Setting up module structure
- Configuring access rights (CSV)
- Creating record rules
- Building wizards (TransientModel)
- Creating reports
文件:
odoo-18-development-guide.md阅读场景:
- 创建新模块
- 编写
__manifest__.py - 设置模块结构
- 配置访问权限(CSV)
- 创建记录规则
- 构建向导(TransientModel)
- 创建报表
Field Guide
字段指南
File:
odoo-18-field-guide.mdWhen to read:
- Defining new model fields
- Choosing appropriate field types (Char, Text, Monetary, etc.)
- Setting field parameters (required, default, index, etc.)
- Creating computed fields
- Setting up relational fields (Many2one, One2many, Many2many)
文件:
odoo-18-field-guide.md阅读场景:
- 定义新模型字段
- 选择合适的字段类型(Char、Text、Monetary等)
- 设置字段参数(required、default、index等)
- 创建计算字段
- 设置关联字段(Many2one、One2many、Many2many)
Manifest Guide
清单指南
File:
odoo-18-manifest-guide.mdWhen to read:
- Configuring
__manifest__.py - Setting up module dependencies
- Defining asset bundles
- Declaring external dependencies (Python, binary)
- Using module hooks (pre_init, post_init, uninstall)
- Understanding auto_install behavior
文件:
odoo-18-manifest-guide.md阅读场景:
- 配置
__manifest__.py - 设置模块依赖
- 定义资源包
- 声明外部依赖(Python、二进制文件)
- 使用模块钩子(pre_init、post_init、uninstall)
- 理解auto_install行为
Migration Guide
迁移指南
File:
odoo-18-migration-guide.mdWhen to read:
- Upgrading modules from earlier versions
- Writing migration scripts (pre, post, end)
- Handling data migration
- Using module hooks (pre_init, post_init, uninstall)
- Version-specific migration logic
文件:
odoo-18-migration-guide.md阅读场景:
- 从旧版本升级模块
- 编写迁移脚本(pre、post、end)
- 处理数据迁移
- 使用模块钩子(pre_init、post_init、uninstall)
- 版本特定的迁移逻辑
Mixins Guide
混合类指南
File:
odoo-18-mixins-guide.mdWhen to read:
- Using mail.thread (messaging, chatter, field tracking)
- Setting up mail.alias.mixin (email aliases)
- Adding mail.activity.mixin (activities)
- Using utm.mixin (campaign tracking)
- Website publishing (website.published.mixin)
- SEO metadata (website.seo.metadata)
- Customer ratings (rating.mixin)
文件:
odoo-18-mixins-guide.md阅读场景:
- 使用mail.thread(消息、 chatter、字段追踪)
- 设置mail.alias.mixin(邮箱别名)
- 添加mail.activity.mixin(活动)
- 使用utm.mixin(营销活动追踪)
- 网站发布(website.published.mixin)
- SEO元数据(website.seo.metadata)
- 客户评分(rating.mixin)
Model Guide
模型指南
File:
odoo-18-model-guide.mdWhen to read:
- Writing model methods
- Using ORM queries (,
search,read,create,write)unlink - Working with domain filters
- Understanding recordsets and prefetching
- Batch operations
文件:
odoo-18-model-guide.md阅读场景:
- 编写模型方法
- 使用ORM查询(、
search、read、create、write)unlink - 处理域过滤器
- 理解记录集与预取
- 批量操作
OWL Guide
OWL指南
File:
odoo-18-owl-guide.mdWhen to read:
- Building OWL components
- Using hooks (useState, onWillStart, onMounted, etc.)
- Using services (orm, rpc, action, dialog, notification)
- Component lifecycle management
- JavaScript/OWL translations with
_t()
文件:
odoo-18-owl-guide.md阅读场景:
- 构建OWL组件
- 使用钩子(useState、onWillStart、onMounted等)
- 使用服务(orm、rpc、action、dialog、notification)
- 组件生命周期管理
- 使用进行JavaScript/OWL翻译
_t()
Performance Guide
性能指南
File:
odoo-18-performance-guide.mdWhen to read:
- Fixing N+1 query problems
- Optimizing slow code
- Reducing database queries
- Understanding prefetch behavior
- Using ,
search_read(),read_group(),mapped()filtered()
文件:
odoo-18-performance-guide.md阅读场景:
- 修复N+1查询问题
- 优化慢代码
- 减少数据库查询
- 理解预取行为
- 使用、
search_read()、read_group()、mapped()filtered()
Reports Guide
报表指南
File:
odoo-18-reports-guide.mdWhen to read:
- Creating QWeb reports (PDF/HTML)
- Writing report templates
- Configuring paper formats
- Creating custom reports with _get_report_values
- Adding barcodes to reports
- Using custom fonts
- Creating translatable reports
文件:
odoo-18-reports-guide.md阅读场景:
- 创建QWeb报表(PDF/HTML)
- 编写报表模板
- 配置纸张格式
- 使用_get_report_values创建自定义报表
- 在报表中添加条形码
- 使用自定义字体
- 创建可翻译报表
Security Guide
安全指南
File:
odoo-18-security-guide.mdWhen to read:
- Configuring access rights (ACL)
- Creating record rules
- Understanding field-level access
- Multi-company security
- Preventing security pitfalls (SQL injection, XSS)
- Public/Portal user security
文件:
odoo-18-security-guide.md阅读场景:
- 配置访问权限(ACL)
- 创建记录规则
- 理解字段级访问
- 多公司安全
- 避免安全陷阱(SQL注入、XSS)
- 公共/门户用户安全
Testing Guide
测试指南
File:
odoo-18-testing-guide.mdWhen to read:
- Writing unit tests (TransactionCase)
- Writing browser tests (HttpCase)
- Using test decorators (@tagged, @users, @warmup)
- Testing with Form class
- Mocking external APIs
- Query count assertions
文件:
odoo-18-testing-guide.md阅读场景:
- 编写单元测试(TransactionCase)
- 编写浏览器测试(HttpCase)
- 使用测试装饰器(@tagged、@users、@warmup)
- 使用Form类测试
- 模拟外部API
- 查询计数断言
Translation Guide
翻译指南
File:
odoo-18-translation-guide.mdWhen to read:
- Adding translatable strings in Python (,
_())_lt() - Adding translatable strings in JavaScript ()
_t() - Creating translatable QWeb templates
- Setting up translated fields ()
translate=True - Managing PO files
- Exporting/importing translations
- Working with languages ()
res.lang
文件:
odoo-18-translation-guide.md阅读场景:
- 在Python中添加可翻译字符串(、
_())_lt() - 在JavaScript中添加可翻译字符串()
_t() - 创建可翻译QWeb模板
- 设置可翻译字段()
translate=True - 管理PO文件
- 导出/导入翻译
- 处理语言()
res.lang
Transaction Guide
事务指南
File:
odoo-18-transaction-guide.mdWhen to read:
- Handling database errors (UniqueViolation, NotNullViolation)
- Using savepoints for error isolation
- Understanding transaction states
- Dealing with serialization failures
- Commit and rollback patterns
文件:
odoo-18-transaction-guide.md阅读场景:
- 处理数据库错误(UniqueViolation、NotNullViolation)
- 使用保存点隔离错误
- 理解事务状态
- 处理序列化失败
- 提交与回滚模式
View Guide
视图指南
File:
odoo-18-view-guide.mdWhen to read:
- Writing list views (use not
<list>in Odoo 18)<tree> - Writing form views
- Writing search views
- Creating view inheritance with xpath
- Writing QWeb templates
- Creating actions and menus
文件:
odoo-18-view-guide.md阅读场景:
- 编写列表视图(Odoo 18中使用而非
<list>)<tree> - 编写表单视图
- 编写搜索视图
- 使用xpath实现视图继承
- 编写QWeb模板
- 创建动作与菜单
File Structure
文件结构
agent-skills/skills/odoo/18.0/
├── SKILL.md # THIS FILE - master index
├── dev/ # Development guides folder
│ ├── odoo-18-actions-guide.md # ir.actions.*, cron, bindings
│ ├── odoo-18-controller-guide.md # HTTP, routing, controllers
│ ├── odoo-18-data-guide.md # XML/CSV data files, records
│ ├── odoo-18-decorator-guide.md # @api decorators
│ ├── odoo-18-development-guide.md # Manifest, wizards (overview)
│ ├── odoo-18-field-guide.md # Field types, parameters
│ ├── odoo-18-manifest-guide.md # __manifest__.py reference
│ ├── odoo-18-mixins-guide.md # mail.thread, activities, etc.
│ ├── odoo-18-model-guide.md # ORM, CRUD, search, domain
│ ├── odoo-18-migration-guide.md # Migration scripts, hooks
│ ├── odoo-18-owl-guide.md # OWL components, services
│ ├── odoo-18-performance-guide.md # N+1 prevention, optimization
│ ├── odoo-18-reports-guide.md # QWeb reports, PDF/HTML
│ ├── odoo-18-security-guide.md # ACL, record rules, security
│ ├── odoo-18-testing-guide.md # Test classes, decorators
│ ├── odoo-18-transaction-guide.md # Savepoints, errors
│ ├── odoo-18-translation-guide.md # Translations, i18n
│ └── odoo-18-view-guide.md # XML views, QWeb
├── CLAUDE.md # Claude Code specific
└── AGENTS.md # AI agents setupagent-skills/skills/odoo/18.0/
├── SKILL.md # 本文件 - 总索引
├── dev/ # 开发指南文件夹
│ ├── odoo-18-actions-guide.md # ir.actions.*、cron、绑定
│ ├── odoo-18-controller-guide.md # HTTP、路由、控制器
│ ├── odoo-18-data-guide.md # XML/CSV数据文件、记录
│ ├── odoo-18-decorator-guide.md # @api装饰器
│ ├── odoo-18-development-guide.md # 清单、向导(概述)
│ ├── odoo-18-field-guide.md # 字段类型、参数
│ ├── odoo-18-manifest-guide.md # __manifest__.py参考
│ ├── odoo-18-mixins-guide.md # mail.thread、活动等
│ ├── odoo-18-model-guide.md # ORM、CRUD、搜索、域
│ ├── odoo-18-migration-guide.md # 迁移脚本、钩子
│ ├── odoo-18-owl-guide.md # OWL组件、服务
│ ├── odoo-18-performance-guide.md # N+1问题预防、优化
│ ├── odoo-18-reports-guide.md # QWeb报表、PDF/HTML
│ ├── odoo-18-security-guide.md # ACL、记录规则、安全
│ ├── odoo-18-testing-guide.md # 测试类、装饰器
│ ├── odoo-18-transaction-guide.md # 保存点、错误
│ ├── odoo-18-translation-guide.md # 翻译、i18n
│ └── odoo-18-view-guide.md # XML视图、QWeb
├── CLAUDE.md # Claude Code 专属
└── AGENTS.md # AI Agent 设置Base Code Reference (Odoo 18)
基础代码参考(Odoo 18)
All guides are based on analysis of Odoo 18 source code:
- - ORM implementation
odoo/models.py - - Field types
odoo/fields.py - - Decorators
odoo/api.py - - HTTP layer
odoo/http.py - - Exception types
odoo/exceptions.py - - Translation system
odoo/tools/translate.py - - Language model
odoo/addons/base/models/res_lang.py - - JS translations
addons/web/static/src/core/l10n/translation.js
For setup instructions with different AI IDEs, see AGENTS.md
所有指南均基于Odoo 18源代码分析:
- - ORM实现
odoo/models.py - - 字段类型
odoo/fields.py - - 装饰器
odoo/api.py - - HTTP层
odoo/http.py - - 异常类型
odoo/exceptions.py - - 翻译系统
odoo/tools/translate.py - - 语言模型
odoo/addons/base/models/res_lang.py - - JS翻译
addons/web/static/src/core/l10n/translation.js
如需不同AI IDE的设置说明,请查看AGENTS.md