Agent Skills › odoo/odoo › odoo-guidelines

odoo-guidelines

GitHub

提供Odoo插件开发的编码规范,涵盖模块结构、Python/ORM、XML视图、安全权限及性能测试等。用于指导或审查Odoo插件代码编写,确保符合最佳实践与一致性标准。

skills/odoo-guidelines/SKILL.md odoo/odoo

Trigger Scenarios

编写Odoo插件代码 审查Odoo插件代码 定义ORM模型或字段 开发控制器或视图

Install

npx skills add odoo/odoo --skill odoo-guidelines -g -y
More Options

Use without installing

npx skills use odoo/odoo@odoo-guidelines

指定 Agent (Claude Code)

npx skills add odoo/odoo --skill odoo-guidelines -a claude-code -g -y

安装 repo 全部 skill

npx skills add odoo/odoo --all -g -y

预览 repo 内 skill

npx skills add odoo/odoo --list

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

Same Skill Collection

skills/odoo-review/SKILL.md
skills/odoo-security/SKILL.md
skills/odoo-web-guidelines/SKILL.md

Metadata

Files
0
Version
5.0.0-2-addons
Hash
51dfc9fc
Indexed
2026-09-27 17:16

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-29 19:03
浙ICP备14020137号-1