ahmed-lakosha

odoo-upgrade

5
3
# Install this skill:
npx skills add ahmed-lakosha/odoo-upgrade-skill

Or install specific skill: npx add-skill https://github.com/ahmed-lakosha/odoo-upgrade-skill

# Description

Comprehensive Odoo ERP upgrade assistant for migrating modules between Odoo versions (14-19). Handles XML views, Python API changes, JavaScript/OWL components, theme SCSS variables, and manifest updates. Use when user asks to upgrade Odoo modules, fix version compatibility issues, migrate themes between versions, or resolve Odoo 17/18/19 migration errors. Specializes in frontend RPC service migrations, view XML transformations, and theme variable restructuring.

# SKILL.md


name: odoo-upgrade
description: Comprehensive Odoo ERP upgrade assistant for migrating modules between Odoo versions (14-19). Handles XML views, Python API changes, JavaScript/OWL components, theme SCSS variables, and manifest updates. Use when user asks to upgrade Odoo modules, fix version compatibility issues, migrate themes between versions, or resolve Odoo 17/18/19 migration errors. Specializes in frontend RPC service migrations, view XML transformations, and theme variable restructuring.


Odoo Upgrade Assistant

A comprehensive skill for upgrading Odoo modules between versions, with extensive pattern recognition and automated fixes for common migration issues.

When to Use This Skill

Activate this skill when:
- User requests upgrading Odoo modules between versions (14→19)
- Fixing Odoo version compatibility errors
- Migrating themes or custom modules
- Resolving RPC service errors in frontend components
- Converting XML views for newer Odoo versions
- Updating SCSS variables for Odoo 19 themes

Upgrade Workflow

1. Initial Analysis

# Analyze source module structure
- Check __manifest__.py version
- Identify module dependencies
- List all file types (XML, Python, JS, SCSS)
- Create backup before changes

2. Manifest Updates

  • Update version number to target format (e.g., "19.0.1.0.0")
  • Add missing 'license' key (default: 'LGPL-3')
  • Declare external dependencies
  • Update category if needed

3. XML/View Transformations

Search Views (Odoo 19)

<!-- BEFORE (Invalid in Odoo 19) -->
<search>
    <group expand="0" string="Group By">
        <filter name="type" string="Type"/>
    </group>
</search>

<!-- AFTER (Valid in Odoo 19) -->
<search>
    <filter name="type" string="Type"/>
</search>

Tree to List Views

<!-- BEFORE -->
<tree string="Title" edit="1" editable="top">

<!-- AFTER -->
<list string="Title" editable="top">

Kanban Templates (Odoo 19)

<!-- BEFORE -->
<t t-name="kanban-box">

<!-- AFTER -->
<t t-name="card">

Form View Context (Odoo 19)

<!-- BEFORE -->
context="{'search_default_type_id': active_id}"

<!-- AFTER -->
context="{'search_default_type_id': id}"

Cron Jobs (Odoo 19)

Remove numbercall field - no longer supported:

<!-- Remove this line -->
<field name="numbercall">-1</field>

4. Python API Migrations

Slug Function (Odoo 18+)

# Add compatibility wrapper
from odoo.http import request

def slug(value):
    """Compatibility wrapper for slug function"""
    return request.env['ir.http']._slug(value)

def unslug(value):
    """Compatibility wrapper for unslug function"""
    return request.env['ir.http']._unslug(value)

URL For Function (Odoo 19)

# BEFORE
from odoo.addons.http_routing.models.ir_http import url_for
url = url_for('/path')

# AFTER
url = self.env['ir.http']._url_for('/path')

5. JavaScript/OWL Frontend Migrations

RPC Service Replacement (Odoo 19)

The RPC service is NOT available in Odoo 19 frontend/public components.

/** @odoo-module **/

// BEFORE (Odoo 17)
import {useService} from "@web/core/utils/hooks";

export class MyComponent extends Component {
    setup() {
        this.rpc = useService("rpc");
    }

    async fetchData() {
        const data = await this.rpc("/api/endpoint", params);
    }
}

// AFTER (Odoo 19)
export class MyComponent extends Component {
    setup() {
        // RPC service removed - using fetch instead
    }

    async _jsonRpc(endpoint, params = {}) {
        try {
            const response = await fetch(endpoint, {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    'X-Csrf-Token': document.querySelector('meta[name="csrf-token"]')?.content || '',
                },
                body: JSON.stringify({
                    jsonrpc: "2.0",
                    method: "call",
                    params: params,
                    id: Math.floor(Math.random() * 1000000)
                })
            });

            if (!response.ok) {
                throw new Error(`HTTP error! status: ${response.status}`);
            }

            const data = await response.json();
            if (data.error) {
                throw new Error(data.error.message || 'RPC call failed');
            }
            return data.result;
        } catch (error) {
            console.error('JSON-RPC call failed:', error);
            throw error;
        }
    }

    async fetchData() {
        const data = await this._jsonRpc("/api/endpoint", params);
    }
}

6. Theme SCSS Variables (Odoo 19)

Proper Structure

// ===================================================================
// Theme Name - Primary Variables
// ===================================================================

// Typography Hierarchy
$o-theme-h1-font-size-multiplier: (64 / 16);
$o-theme-headings-font-weight: 700;  // NOT $headings-font-weight

// Website Values Palette
$o-website-values-palettes: (
    (
        'color-palettes-name': 'my_theme',
        'font': 'Inter',
        'headings-font': 'Inter',
        'btn-padding-y': 1rem,  // Use rem not px
        'btn-padding-x': 2rem,
    ),
);

// Color Palette with menu/footer assignments
$o-color-palettes: map-merge($o-color-palettes, (
    'my_theme': (
        'o-color-1': #124F81,
        'o-color-2': #B1025D,
        'o-color-3': #f8fafc,
        'o-color-4': #ffffff,
        'o-color-5': #1e293b,
        'menu': 1,        // IMPORTANT: Specify which color for menu
        'footer': 4,      // IMPORTANT: Specify which color for footer
        'copyright': 5,   // IMPORTANT: Specify which color for copyright
    ),
));

// Font Configuration (use map-merge!)
$o-theme-font-configs: map-merge($o-theme-font-configs, (
    'Inter': (
        'family': ('Inter', sans-serif),
        'url': 'Inter:300,400,500,600,700&display=swap',
        'properties': (  // IMPORTANT: Add properties section
            'base': (
                'font-size-base': 1rem,
                'line-height-base': 1.6,
            ),
        )
    ),
));

7. Theme Snippet System (Odoo 19)

Remove incompatible website.snippet_options inheritance:

<!-- REMOVE this template - not compatible with Odoo 19 -->
<template id="custom_footer_op" inherit_id="website.snippet_options">
    <!-- Snippet options content -->
</template>

Common Errors and Solutions

Error: "Service rpc is not available"

  • Cause: Using useService("rpc") in frontend components
  • Solution: Replace with _jsonRpc helper method using fetch API

Error: "Invalid field 'numbercall' in 'ir.cron'"

  • Cause: Field removed in Odoo 19
  • Solution: Remove <field name="numbercall"> from cron definitions

Error: "Invalid view definition" (search views)

  • Cause: <group> tags not allowed in search views (Odoo 19)
  • Solution: Remove <group> tags, keep filters at root level

Error: "Missing 'card' template"

  • Cause: Kanban template name changed in Odoo 19
  • Solution: Change t-name="kanban-box" to t-name="card"

Error: "cannot import name 'slug'"

  • Cause: Import location changed in Odoo 18+
  • Solution: Add compatibility wrapper function

Error: "External ID not found: website.snippet_options"

  • Cause: Snippet system changed in Odoo 19
  • Solution: Remove the incompatible template

Error: "field 'active_id' does not exist"

  • Cause: active_id not available in form view contexts (Odoo 19)
  • Solution: Replace active_id with id

Testing Checklist

After upgrade, test:
- [ ] Module installation without errors
- [ ] All views load correctly
- [ ] JavaScript components function
- [ ] Theme displays properly
- [ ] API endpoints respond
- [ ] Cron jobs execute
- [ ] Search/filter functionality
- [ ] Form submissions work
- [ ] Reports generate correctly

Helper Commands

# Install upgraded module
python -m odoo -d [DB] -i [MODULE] --addons-path=odoo/addons,projects/[PROJECT] --stop-after-init

# Update module after changes
python -m odoo -d [DB] -u [MODULE] --stop-after-init

# Run with development mode for debugging
python -m odoo -d [DB] --dev=xml,css,js

# Install Python dependencies
pip install geopy spacy hachoir

Migration Report Template

Generate comprehensive reports documenting:
- Files modified count
- Lines changed
- Patterns applied
- Manual fixes needed
- External dependencies added
- Testing status
- Known issues
- Rollback instructions

Advanced Patterns

Multi-Module Projects

When upgrading projects with multiple interdependent modules:
1. Analyze dependency tree
2. Upgrade in dependency order
3. Test each module individually
4. Test integrated functionality

Theme Migrations

Special considerations for themes:
1. SCSS variable structure changes
2. Bootstrap version compatibility
3. Snippet system updates
4. Asset bundling changes

Performance Optimization

After upgrade:
1. Regenerate assets
2. Clear caches
3. Recompile Python files
4. Optimize database indexes

Version-Specific Notes

Odoo 17 → 18

  • Minor XML changes
  • Python API mostly compatible
  • JavaScript minor updates

Odoo 18 → 19

  • Major frontend architecture changes
  • RPC service removed from public
  • Snippet system overhaul
  • Kanban template naming changes
  • Search view structure changes

Odoo 16 → 17

  • OWL framework adoption
  • Widget system changes
  • Asset pipeline updates

References

# README.md

GitHub release
GitHub stars
License

Odoo Upgrade Skill for Claude Code

A comprehensive Claude Code skill for automating Odoo ERP module upgrades between versions 14-19, with special focus on the breaking changes in Odoo 19.

🚀 Features

  • Automated Pattern Detection: Identifies and fixes common migration issues
  • Multi-Version Support: Handles migrations from Odoo 14 through 19
  • RPC Service Migration: Automatically converts frontend RPC calls for Odoo 19
  • XML Transformation: Fixes view definitions, kanban templates, and search views
  • Python API Updates: Handles import changes and deprecated methods
  • Theme Migration: Updates SCSS variables and font configurations
  • Comprehensive Error Catalog: Documents 25+ common errors with solutions
  • Helper Scripts: Python scripts for batch processing

📦 Installation

As a Claude Code Skill

  1. Copy the skill to your Claude Code skills directory:
# For project-specific use
cp -r C:\tmp\plugins\odoo-upgrade-skill .claude\skills\

# For global use
cp -r C:\tmp\plugins\odoo-upgrade-skill %USERPROFILE%\.claude\skills\
  1. The skill will be automatically available when you ask Claude to upgrade Odoo modules.

As a Standalone Tool

  1. Clone or copy the repository:
git clone <repository-url> odoo-upgrade-skill
cd odoo-upgrade-skill
  1. Install Python dependencies:
pip install lxml

🎯 Quick Start

Using with Claude Code

Simply ask Claude:
- "Upgrade my Odoo module from version 17 to 19"
- "Fix RPC service errors in my Odoo 19 module"
- "Migrate my theme to Odoo 19"

Claude will automatically use this skill when detecting Odoo upgrade tasks.

Using Helper Scripts Standalone

Fix RPC Service Issues

python scripts/fix_rpc_service.py path/to/module

Update Manifests

python scripts/upgrade_manifest.py path/to/module --target 19

Process Entire Project

python scripts/upgrade_manifest.py path/to/project --recursive --target 19
python scripts/fix_rpc_service.py path/to/project

📋 What Gets Fixed

JavaScript/Frontend (Odoo 19)

  • ✅ RPC service removal and replacement with fetch
  • ✅ Module annotations (/** @odoo-module **/)
  • ✅ Service registration changes
  • ✅ Import path updates

XML Views

  • <tree><list> conversion
  • ✅ Remove edit="1" attributes
  • ✅ Fix search view <group> tags
  • ✅ Replace active_id with id
  • ✅ Kanban template name changes (kanban-boxcard)
  • ✅ Remove js_class attributes
  • ✅ Remove numbercall from cron jobs

Python Code

  • slug function compatibility
  • url_for import changes
  • ✅ External dependency declarations
  • ✅ API decorator updates

Themes/SCSS

  • ✅ Variable naming conventions
  • ✅ Font configuration with map-merge
  • ✅ Color palette menu/footer assignments
  • ✅ Unit conversions (px → rem)

Manifests

  • ✅ Version format (e.g., 19.0.1.0.0)
  • ✅ Missing license key
  • ✅ External dependencies
  • ✅ Auto-detect Python packages

🔍 Example: Relief Center Migration

This skill was developed while migrating a complex humanitarian aid system from Odoo 17 to 19:

Project Stats:
- 5 interdependent modules
- 115 files analyzed
- 32 files modified
- 450+ lines changed
- 10 RPC calls migrated
- 7 JavaScript components fixed

Key Issues Resolved:
1. Frontend RPC service unavailable
2. Kanban views broken
3. Search filters not working
4. Theme colors not applying
5. MapTiler integration failing

📚 Documentation Structure

odoo-upgrade-skill/
├── SKILL.md                    # Main skill definition
├── patterns/
│   ├── common_patterns.md      # Universal patterns
│   └── odoo18_to_19.md        # Version-specific changes
├── fixes/
│   ├── xml_fixes.md            # XML transformation templates
│   └── javascript_fixes.md     # JS/OWL migration templates
├── scripts/
│   ├── upgrade_manifest.py     # Manifest updater
│   └── fix_rpc_service.py      # RPC service fixer
├── reference/
│   └── error_catalog.md        # 25+ common errors
└── README.md                    # This file

🛠️ Manual Intervention Required

Some issues require manual review:
- Complex business logic changes
- Custom widget rewrites
- Third-party module compatibility
- Database schema migrations
- Report template updates

🧪 Testing After Upgrade

Always test after upgrading:

# Install upgraded module
python -m odoo -d test_db -i module_name --stop-after-init

# Run with development mode
python -m odoo -d test_db --dev=xml,css,js

# Run tests
python -m odoo -d test_db --test-enable -i module_name

🔄 Version Compatibility

From Version To Version Difficulty Major Changes
17 → 18 18 Low Minor API changes
18 → 19 19 High RPC removal, view changes
17 → 19 19 Very High Complete frontend rewrite
16 → 17 17 Medium OWL framework adoption

🚨 Common Pitfalls

  1. Not backing up before upgrade
  2. Upgrading all modules at once instead of incrementally
  3. Ignoring external dependencies in manifests
  4. Not clearing asset cache after changes
  5. Missing theme color assignments (menu, footer)

🤝 Contributing

To improve this skill:

  1. Document new error patterns
  2. Add fix templates for new issues
  3. Update version-specific guides
  4. Share migration experiences

📄 License

LGPL-3.0 (Compatible with Odoo licensing)

🙏 Acknowledgments

Developed during the successful migration of the Relief Center humanitarian aid system, processing real-world production code with complex interdependencies.

📞 Support

For issues or improvements:
- Create an issue in the repository
- Submit pull requests with new patterns
- Share your migration experiences

🎯 Pro Tips

  1. Always upgrade in a test environment first
  2. Use version control - commit before and after each major change
  3. Test incrementally - one module at a time
  4. Document custom changes that the skill can't handle
  5. Keep the skill updated as new Odoo versions are released

Built with real-world experience from production Odoo migrations## 🚀 Quick Install

# Clone the skill
git clone https://github.com/ahmed-lakosha/odoo-upgrade-skill.git

# Copy to Claude skills directory (Windows)
xcopy /E /I odoo-upgrade-skill %USERPROFILE%\.claude\skills\odoo-upgrade-skill

# Or for Linux/Mac
cp -r odoo-upgrade-skill ~/.claude/skills/

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.