Agent Skills
› odoo/odoo
› odoo-guidelines
odoo-guidelines
GitHub提供Odoo插件开发的编码规范,涵盖模块结构、Python/ORM、XML视图、安全权限及性能测试等。用于指导或审查Odoo插件代码编写,确保符合最佳实践与一致性标准。
Trigger Scenarios
编写Odoo插件代码
审查Odoo插件代码
定义ORM模型或字段
开发控制器或视图
Install
npx skills add odoo/odoo --skill odoo-guidelines -g -y
SKILL.md
Frontmatter
{
"name": "odoo-guidelines",
"description": "House rules for Odoo addon code: module structure, manifest, Python\/ORM, fields, controllers, XML views and data, QWeb reports, access rights and record rules, performance, tests. Use when writing or reviewing any file in an Odoo addon outside static\/ (for the JavaScript, Owl templates and SCSS under static\/, see odoo-web-guidelines)."
}
Odoo addon guidelines
House rules for code in Odoo addons (addons/* and odoo/addons/*).
Everything an addon ships under static/ has its own skill:
odoo-web-guidelines.
Guidelines are grouped by domain, one file per domain in guidelines/, one section per
guideline. No rule outranks another. Read the sections that match the files you are
touching instead of loading whole files.
| Guideline | Read it when |
|---|---|
| Module structure and file naming | creating or moving files in an addon, or adding a module |
| Manifest | touching __manifest__.py |
| Imports | writing Python anywhere in an addon |
| Naming and model layout | naming a model, field, method or variable; laying out a model class |
| Translate only static literals | user-facing strings in Python |
| Recordsets, domains and context | reading records, building domains, passing context |
| Computes, onchange and constraints | computes, onchange, constraints, indexes, create overrides |
| Methods and extension points | adding a model method, or one another module will override |
| Transactions and exceptions | cursors, commits, savepoints, try/except |
| Fields | declaring or modifying field definitions |
| Controllers | touching controllers/ or @route |
| Views, actions and data records | touching views/, data/, or any XML records |
| Anchor view inheritance on names, never on position | extending or overriding an existing view |
| QWeb PDF reports | report templates or _get_report_values |
| Access rights | touching security/ (ir.access.csv, groups) |
| Batch ORM calls | ORM calls (create/search*/aggregates) inside a loop |
| Performance conventions | code that loops over records or filters query results |
| Tests | touching tests/ |
| Plain ASCII punctuation in comments and messages | writing a comment, a docstring, a user-facing string, or a commit message |
| Changes in a stable version | any change targeting a released branch rather than master |
To add or restructure a guideline, follow AUTHORING.md.
Version History
- 5.0.0-2-addons Current 2026-09-27 17:16


