odoo-migration-helper
Step-by-step guide for migrating Odoo custom modules between versions (v14→v15→v16→v17). Covers API changes, deprecated methods, and view migration.
它会碰到什么
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
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.
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
它属于哪个仓库
plugins/agentic-awesome-skills-claude/skills/odoo-migration-helper/SKILL.md同一个仓库里的其他技能
同名技能的其他版本
有 3 个不同仓库或目录里都有叫 odoo-migration-helper 的技能。它们内容并不相同,别混用:
- sickn33/agentic-awesome-skills — Step-by-step guide for migrating Odoo custom modules between versions (v14→v15→v16→v17). C
- sickn33/agentic-awesome-skills — Step-by-step guide for migrating Odoo custom modules between versions (v14→v15→v16→v17). C