后端

数据 社区

技能解读

当前原文的自动摘译,尚未人工审校。

快捷路线

如果任务是关于... · 读取__manifest__.py,XML/CSV 加载,record/function 标签,noupdate · 核心模块结构和数据记录集,_inherit,_inherits,保留字段,约束/索引属性 · core-orm-models-recordsets 计算/相关字段, @api.depends、@api.onchange、@api.constrains、@api.model_create_multi、@api.private·核心字段和装饰器域、search_fetch、_read_group、原始 SQL、SQL(...)、刷新、缓存失效、modified(...)·核心域 sql 和缓存

后端默认值

模型方法可能接收空或多记录self;明确地强制执行单例语义。公共模型方法是 RPC 可达的。确保 Python、ACL 和规则的安全性,而不仅仅是视图中的安全性。更喜欢 ORM。如果需要 SQL,请在读/写之前刷新并在写之后使缓存无效。默认情况下的批处理:_read_group、批处理create、记录集感知循环和查询计数检查捕获大多数回归。

跨技能指导

当请求广泛、不明确或跨越多个 Odoo 域时,请使用 odoo 路由器。当任务主要是 Web 客户端 JavaScript、视图、小部件、arch XML 或前端资产时,请使用 odoo 前端技能。当任务是 Hoot、Web 测试助手、模拟服务器工作或前端 JS 测试内部时,请使用 odoo-javascript-testing 技能。来源:basaltbytes/skills — 由 TomeVault 分发。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
数据
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@tomevault-io · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
Python
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
  • 命令执行
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

> The skill is based on Odoo 19.0 backend and external API documentation, generated at 2026-04-22.

# Odoo 19 Backend

Use this for Odoo-specific server behavior agents often get wrong. It skips generic Python, ORM, and XML material. Load only the narrowest reference that matches the task.

## Quick Route

| If the task is about... | Read |
| --- | --- |
| `__manifest__.py`, XML/CSV loading, `record`/`function` tags, `noupdate` | [core-module-structure-and-data](references/core-module-structure-and-data.md) |
| recordsets, `_inherit`, `_inherits`, reserved fields, constraint/index attrs | [core-orm-models-recordsets](references/core-orm-models-recordsets.md) |
| computed/related fields, `@api.depends`, `@api.onchange`, `@api.constrains`, `@api.model_create_multi`, `@api.private` | [core-fields-and-decorators](references/core-fields-and-decorators.md) |
| domains, `search_fetch`, `_read_group`, raw SQL, `SQL(...)`, flushing, cache invalidation, `modified(...)` | [core-domains-sql-and-cache](references/core-domains-sql-and-cache.md) |
| ACL CSVs, record rules, `sudo`, field `groups=`, RPC exposure, SQL injection, `safe_eval`, escaping HTML | [core-security-acl-and-rules](references/core-security-acl-and-rules.md) |
| action dicts, `ir.actions.server`, `ir.cron`, `_commit_progress` | [features-actions-and-cron](references/features-actions-and-cron.md) |
| Python controllers, `@route`, request env, controller inheritance | [features-controllers-and-http](references/features-controllers-and-http.md) |
| external integrations, bearer-key JSON-2, `/json/2`, legacy XML-RPC / JSON-RPC `execute_kw` | [features-external-api-and-rpc](references/features-external-api-and-rpc.md) |
| QWeb PDF/HTML reports, paper formats, custom `_get_report_values`, report assets/fonts | [features-qweb-reports](references/features-qweb-reports.md) |
| `mail.thread`, aliases, activities, common backend mixins | [features-common-mixins](references/features-common-mixins.md) |
| `TransactionCase`, `HttpCase`, `Form`, `--test-tags`, tours, query-count assertions | [testing-backend-and-tours](references/testing-backend-and-tours.md) |
| profiling, batching, prefetch, query budgets, indexes | [performance-profiling-and-batching](references/performance-profiling-and-batching.md) |
| final review pass, Odoo 19 deltas, common regressions | [best-practices-odoo-19-backend](references/best-practices-odoo-19-backend.md) |

## Backend Defaults

- Model methods may receive empty or multi-record `self`; enforce singleton semantics explicitly.
- Public model methods are RPC-reachable. Keep security in Python, ACLs, and rules, not only in views.
- Prefer ORM. If SQL is necessary, flush before reads/writes and invalidate cache after writes.
- Batch by default: `_read_group`, batch `create`, recordset-aware loops, and query-count checks catch most regressions.
- Keep real invariants on models, not only in `onchange`, cron wrappers, or controllers.
- Before shipping, read [best-practices-odoo-19-backend](references/best-practices-odoo-19-backend.md).

## Cross-Skill Guidance

- Use the [odoo router](../odoo/SKILL.md) when the request is broad, ambiguous, or spans multiple Odoo domains.
- Use the [odoo-frontend skill](../odoo-frontend/SKILL.md) when the task is primarily web-client JavaScript, views, widgets, arch XML, or frontend assets.
- Use the [odoo-javascript-testing skill](../odoo-javascript-testing/SKILL.md) when the task is Hoot, web test helpers, mock-server work, or frontend JS testing internals.

---
> Source: [basaltbytes/skills](https://github.com/basaltbytes/skills) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。