Inspiration

Every year, Odoo releases a new version with significant breaking changes shifting from QWeb to OWL, overhauling Python APIs, and deprecating old views. For developers, migrating a custom module from an older version to the cutting-edge v19 is a tedious, error-prone accumulation of manual "find-and-replace" tasks. We built Paami to turn this week-long headache into a logical, automated workflow.

What it does

Paami is a VS Code Extension that acts as an intelligent migration assistant. Code Transformation: It scans your Odoo module and automatically upgrades Python code (API changes) and XML views (syntax updates) to be compatible with Odoo 19. AI Reasoning: For complex logic that requires context like rewriting JavaScript widgets to OWL components Paami uses AI to infer the intent and refactor the code. Safety First: It creates local backups before running and supports "checkpointing," allowing you to pause and resume the migration process without losing state.

How we built it

We chose TypeScript and the VS Code Extension API to meet developers where they already work. The Engine: We built a custom ConversionEngine that orchestrates the migration pipeline using a dependency-aware graph, ensuring files are processed in the correct order. Hybrid Approach: We combined AST/Regex-based rules for deterministic changes (like renaming openerp to odoo) with the OpenRouter API for semantic reasoning on complex code blocks. State Management: We implemented a persistent state system to track the progress of every file transformation, enabling the robust "Resume" capability.

Challenges we ran into

Odoo's Evolution: Mapping 6 years of API changes (v13 to v19) was massive. We had to research and strictly define the transformation rules for each version jump. Context Management: Feeding the right amount of code context to the AI without exceeding token limits was tricky. We had to devise a strategy to send only the relevant "code chunks" for processing. IDE Performance: processing large modules could freeze the UI. We had to ensure all heavy lifting happened asynchronously without blocking the VS Code editor interactiveness.

Accomplishments that we're proud of

Successfully automating the migration of XML views, which is often the most tedious part of Odoo upgrades. Building a Resilient Task System that survives IDE restarts if you close VS Code in the middle of a migration, Paami remembers exactly where it left off. Creating a UI that feels native to VS Code, with a seamless chat interface for guidance.

What we learned

AST > Regex: For reliable code refactoring, structural understanding (Abstract Syntax Trees) is infinitely better than string manipulation. Human-in-the-loop: Automated tools should assist, not dictate. Adding a chat interface allows developers to clarify why a change was made, which builds trust.

What's next for Paami

Deep OWL Support: Improving the AI's ability to rewrite complex legacy JavaScript (Widgets) into modern Odoo OWL components. Batch Processing: Allowing users to upgrade multiple modules in a single workspace simultaneously. Marketplace Launch: Polishing the extension for a public release on the VS Code Marketplace.

Built With

Share this project:

Updates