[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-eb9d19c1-25ca-4141-99e9-2fb9e637f22a":3,"$ftjIejl-WZxvoUmgUK5YRILsnF-mURlvsgxCXhNF_dGo":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"eb9d19c1-25ca-4141-99e9-2fb9e637f22a","odoo-migration-helper","逐步迁移Odoo自定义模块版本间（v14→v15→v16→v17）指南。涵盖API更改、已弃用方法和视图迁移。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: odoo-migration-helper\ndescription: \"Step-by-step guide for migrating Odoo custom modules between versions (v14→v15→v16→v17). Covers API changes, deprecated methods, and view migration.\"\nrisk: safe\nsource: \"self\"\n---\n\n# Odoo Migration Helper\n\n## Overview\n\nMigrating 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.\n\n## When to Use This Skill\n\n- Upgrading a custom module from Odoo 14\u002F15\u002F16 to a newer version.\n- Getting a checklist of things to check before running `odoo-upgrade`.\n- Fixing deprecation warnings after a version upgrade.\n- Understanding what changed between two specific Odoo versions.\n\n## How It Works\n\n1. **Activate**: Mention `@odoo-migration-helper`, specify your source and target versions, and paste your module code.\n2. **Analyze**: Receive a list of breaking changes with before\u002Fafter code fixes.\n3. **Validate**: Get a migration checklist specific to your module's features.\n\n## Key Migration Changes by Version\n\n### Odoo 16 → 17\n\n| Topic | Old (v16) | New (v17) |\n|---|---|---|\n| View visibility | `attrs=\"{'invisible': [...]}\"` | `invisible=\"condition\"` |\n| Chatter | `\u003Cdiv class=\"oe_chatter\">` | `\u003Cchatter\u002F>` |\n| Required\u002FReadonly | `attrs=\"{'required': [...]}\"` | `required=\"condition\"` |\n| Python minimum | 3.10 | 3.10+ |\n| JS modules | Legacy `define(['web.core'])` | ES module `import` syntax |\n\n### Odoo 15 → 16\n\n| Topic | Old (v15) | New (v16) |\n|---|---|---|\n| Website published flag | `website_published = True` | `is_published = True` |\n| Mail aliases | `alias_domain` on company | Moved to `mail.alias.domain` model |\n| Report render | `_render_qweb_pdf()` | `_render_qweb_pdf()` (same, but signature changed) |\n| Accounting move | `account.move.line` grouping | Line aggregation rules updated |\n| Email threading | `mail_thread_id` | Deprecated; use `message_ids` |\n\n## Examples\n\n### Example 1: Migrate `attrs` visibility to Odoo 17\n\n```xml\n\u003C!-- v16 — domain-based attrs -->\n\u003Cfield name=\"discount\" attrs=\"{'invisible': [('product_type', '!=', 'service')]}\"\u002F>\n\u003Cfield name=\"discount\" attrs=\"{'required': [('state', '=', 'sale')]}\"\u002F>\n\n\u003C!-- v17 — inline Python expressions -->\n\u003Cfield name=\"discount\" invisible=\"product_type != 'service'\"\u002F>\n\u003Cfield name=\"discount\" required=\"state == 'sale'\"\u002F>\n```\n\n### Example 2: Migrate Chatter block\n\n```xml\n\u003C!-- v16 -->\n\u003Cdiv class=\"oe_chatter\">\n    \u003Cfield name=\"message_follower_ids\"\u002F>\n    \u003Cfield name=\"activity_ids\"\u002F>\n    \u003Cfield name=\"message_ids\"\u002F>\n\u003C\u002Fdiv>\n\n\u003C!-- v17 -->\n\u003Cchatter\u002F>\n```\n\n### Example 3: Migrate website_published flag (v15 → v16)\n\n```python\n# v15\nrecord.website_published = True\n\n# v16+\nrecord.is_published = True\n```\n\n## Best Practices\n\n- ✅ **Do:** Test with `--update=your_module` on each version before pushing to production.\n- ✅ **Do:** Use the official [Odoo Upgrade Guide](https:\u002F\u002Fupgrade.odoo.com\u002F) to get an automated pre-upgrade analysis report.\n- ✅ **Do:** Check OCA migration notes and the module's `HISTORY.rst` for community modules.\n- ✅ **Do:** Run `npm run validate` after migration to catch manifest or frontmatter issues early.\n- ❌ **Don't:** Skip intermediate versions — go v14→v15→v16→v17 sequentially; never jump.\n- ❌ **Don't:** Forget to update `version` in `__manifest__.py` (e.g., `17.0.1.0.0`).\n- ❌ **Don't:** Assume OCA modules are migration-ready; check their GitHub branch for the target version.\n\n## Limitations\n\n- Covers **v14 through v17** only — does not address v13 or older (pre-manifest era has fundamentally different module structure).\n- The **Odoo.sh automated upgrade** path has additional steps not covered here; refer to Odoo.sh documentation.\n- **Enterprise-specific modules** (e.g., `account_accountant`, `sign`) may have undocumented breaking changes; test on a staging environment with Enterprise license.\n- JavaScript OWL component migration (v15 Legacy → v16 OWL) is a complex topic not fully covered by this skill.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,239,1277,"2026-05-16 13:32:12",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"5727ed63-2a51-4884-92da-938503ac130d","1.0.0","odoo-migration-helper.zip",2024,"uploads\u002Fskills\u002Feb9d19c1-25ca-4141-99e9-2fb9e637f22a\u002Fodoo-migration-helper.zip","102fa94515b8c60e6bcc6cdb4bd6aa22ccadb2f35d3d11220897eecdd065641e","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":4113}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]