odoo-migration-helper
它能做什么
本指南帮你把自定义的 Odoo 程序从一个版本升级到另一个版本(例如从 14 升到 15,或从 16 升到 17)。它会列出最常见、可能导致代码出错的改动,并告诉你如何修复。
适用场景
- ✓需要把旧的 Odoo 程序升级到新版本时。
- ✓升级 Odoo 之前,想要一份需要检查事项的清单时。
- ✓升级后出现报错,需要修复时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-migration-helper/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我把模块从 Odoo 16 迁移到 17,重点关注字段可见性的变化和 chatter(聊天记录区)。”
每周 5 个新技能,1 分钟读完。
工作原理
你告诉我正在使用的新旧 Odoo 版本,并把程序代码发给我。我会分析需要做的改动,然后给你一份带修复方案的分步指南。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Odoo Migration Helper
Overview
Migrating Odoo modules between major versions requires careful handling of API changes, deprecated methods, renamed fields, and new view syntax. This skill guides you through the migration process systematically, covering the most common breaking changes between versions.
When to Use This Skill
- Upgrading a custom module from Odoo 14/15/16 to a newer version.
- Getting a checklist of things to check before running
odoo-upgrade. - Fixing deprecation warnings after a version upgrade.
- Understanding what changed between two specific Odoo versions.
How It Works
- Activate: Mention
@odoo-migration-helper, specify your source and target versions, and paste your module code. - Analyze: Receive a list of breaking changes with before/after code fixes.
- Validate: Get a migration checklist specific to your module's features.
Key Migration Changes by Version
Odoo 16 → 17
| Topic | Old (v16) | New (v17) |
|---|---|---|
| View visibility | attrs="{'invisible': [...]}" |
invisible="condition" |
| Chatter | <div class="oe_chatter"> |
<chatter/> |
| Required/Readonly | attrs="{'required': [...]}" |
required="condition" |
| Python minimum | 3.10 | 3.10+ |
| JS modules | Legacy define(['web.core']) |
ES module import syntax |
Odoo 15 → 16
| Topic | Old (v15) | New (v16) |
|---|---|---|
| Website published flag | website_published = True |
is_published = True |
| Mail aliases | alias_domain on company |
Moved to mail.alias.domain model |
| Report render | _render_qweb_pdf() |
_render_qweb_pdf() (same, but signature changed) |
| Accounting move | account.move.line grouping |
Line aggregation rules updated |
| Email threading | mail_thread_id |
Deprecated; use message_ids |
Examples
Example 1: Migrate attrs visibility to Odoo 17
<!-- v16 — domain-based attrs -->
<field name="discount" attrs="{'invisible': [('product_type', '!=', 'service')]}"/>
<field name="discount" attrs="{'required': [('state', '=', 'sale')]}"/>
<!-- v17 — inline Python expressions -->
<field name="discount" invisible="product_type != 'service'"/>
<field name="discount" required="state == 'sale'"/>
Example 2: Migrate Chatter block
<!-- v16 -->
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
<!-- v17 -->
<chatter/>
Example 3: Migrate website_published flag (v15 → v16)
# v15
record.website_published = True
# v16+
record.is_published = True
Best Practices
- ✅ Do: Test with
--update=your_moduleon each version before pushing to production. - ✅ Do: Use the official Odoo Upgrade Guide to get an automated pre-upgrade analysis report.
- ✅ Do: Check OCA migration notes and the module's
HISTORY.rstfor community modules. - ✅ Do: Run
npm run validateafter migration to catch manifest or frontmatter issues early. - ❌ Don't: Skip intermediate versions — go v14→v15→v16→v17 sequentially; never jump.
- ❌ Don't: Forget to update
versionin__manifest__.py(e.g.,17.0.1.0.0). - ❌ Don't: Assume OCA modules are migration-ready; check their GitHub branch for the target version.
Limitations
- Covers v14 through v17 only — does not address v13 or older (pre-manifest era has fundamentally different module structure).
- The Odoo.sh automated upgrade path has additional steps not covered here; refer to Odoo.sh documentation.
- Enterprise-specific modules (e.g.,
account_accountant,sign) may have undocumented breaking changes; test on a staging environment with Enterprise license. - JavaScript OWL component migration (v15 Legacy → v16 OWL) is a complex topic not fully covered by this skill.
常见问题
这份指南覆盖哪些 Odoo 版本?
覆盖 Odoo 14、15、16 和 17 版本之间的升级。
什么是 chatter?
chatter 是 Odoo 中显示某条记录的消息、关注者和活动的区域。在 16 和 17 版本之间,把它加入代码的方式有所变化。
我需要一个版本一个版本地升级吗?
建议这样做,即从一个版本升级到下一个版本(例如先 14 升到 15,再 15 升到 16),而不是跨版本跳跃。
详情
作者的原始描述
Step-by-step guide for migrating Odoo custom modules between versions (v14→v15→v16→v17). Covers API changes, deprecated methods, and view migration.
热度
- GitHub 星标
- 48k
- 排名
- #5343
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。