Ingles version : The System Prompt That Automates Odoo Module Migration Between Versions with AI

Migrar módulos de Odoo anualmente es costoso y complejo. Por eso, muchas empresas posponen sus actualizaciones hasta el fin del soporte oficial o se estancan en versiones obsoletas.

La Inteligencia Artificial cambia este paradigma.

Hemos diseñado y validado un System Prompt para automatizar gran parte de este esfuerzo.
El resultado: Migración exitosa de un módulo extenso desde Odoo v12 hasta v19.

Lo comparto en código abierto para la comunidad.

El System Prompt

Fragmento principal. Puedes descargar el prompt completo desde el repositorio de GitHub 👇:

https://github.com/nodenhq/devx/blob/main/odoo-migration-agent.md

**Purpose**: This document provides comprehensive directives for any AI agent to migrate Odoo modules from version 12 to any target version up to 19. Apply ONLY the rules relevant to your source → target version range.

**Agent behavior**:
- ALWAYS read and understand the full module structure before making changes.
- Preserve the module's directory structure (models/, views/, security/, data/, etc.).
- Apply rules **in version order** (v12→v13 first, then v13→v14, etc.) — do NOT skip versions.
- After completing all transformations, do a final scan for leftover deprecated patterns.

> **CRITICAL (Anti-Hallucination)**: If you encounter code, XML tags, or logic that you **cannot migrate with certainty**, do NOT invent code. Leave the original code (commented if appropriate) and add: `# TODO_AI: [Explanation of what could not be migrated and why]` for human review.

## General Rules (Apply Always)

### Manifest File
- Rename `__openerp__.py` → `__manifest__.py` (if still named `__openerp__.py`).
- Set `"installable": True` in the manifest.
- Remove the `migrations/` folder from the module if it exists.
- Update the `version` field to match the target Odoo version (e.g., `"19.0.1.0.0"`).
- Remove `` → replace with `` in XML data files.
- Remove the `string="..."` attribute from `` / `` tags in XML.


## v12 → v13 Changes

### Python (.py)

#### Decorators Removed
- **Remove** `@api.multi` (lines containing it should be deleted entirely).
- **Remove** `@api.one` (lines containing it should be deleted entirely).
- **Flag as error** `@api.returns` — deprecated decorator, must be manually reviewed.
- **Flag as error** `@api.cr`, `@api.model_cr`, `@api.model_cr_context` — deprecated decorators.

Ficha de la Migración

Trayectoria de versiones: v12 → v13 → v14 → v15 → v16 → v17 → v18 → v19 (7 saltos)
Resultado: Módulo instalado en Odoo v19 de forma limpia, sin errores ni advertencias.

Volumen del código migrado

MétricaVolumenDetalle
Archivos4718 Python, 26 XML, 1 CSV
Líneas de código~5,9871,969 LOC Python, 3,795 LOC XML, 88 LOC CSV
Modelos2923 propios, 6 heredados (res.partner, res.users, res.company, etc.)
Campos~295Campos definidos en los modelos
Interfaz y vistas11250 vistas, 26 acciones, 36 menús
Seguridad6969 grupos de seguridad, 87 reglas ACL
Estructura9Directorios base: models/, views/, security/, data/, etc.

Stack tecnológico implementado

  • Entorno base: Odoo 19 y PostgreSQL (Imágenes Docker validado en Docker Compose)
  • Desarrollo: Python 3.12+, OWL framework
  • Motores IA ejecutados: Claude Code + Claude Opus 4.6