odoo-ps/ps-ai-skills · Archived

odoo_upgrade_utils

"Standard Odoo upgrade helpers for field/model renaming, XMLID management, and view patching. Essential for safe data migrations across Odoo versions."

Hot #3502

Installation

$ npx skills add odoo-ps/ps-ai-skills --skill odoo_upgrade_utils

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from odoo-ps/ps-ai-skills · top by installs.

npx skills add odoo-ps/ps-ai-skills

Browse all from odoo-ps/ps-ai-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,303 B
  • docs SUMMARY.md 175 B

History

  1. First recorded snapshot · 8 installs

SKILL.md

Odoo Upgrade Utils Skill

Use the odoo.upgrade.util module for safe data migrations. These helpers handle complex database operations and ensure consistent updates across the Odoo registry.

Summary of Helpers

  • util.renamefield(cr, model, oldname, new_name):

- Renames the column in the database and updates ir.model.fields, ir.model.data, and ir.ui.view references.

  • util.removefield(cr, model, fieldname):

- Safely deletes a field and its data.

  • util.movefieldtomodule(cr, model, fieldname, oldmodule, new_module):

- Moves a field's metadata from one module to another.

  • util.renamemodel(cr, oldname, new_name):

- Renames the model and updates all its associated XMLIDs and metadata.

  • util.renamexmlid(cr, oldxmlid, new_xmlid):

- Renames an external ID. oldxmlid and newxmlid should be fully qualified (e.g., base.group_user).

  • util.edit_view(cr, xmlid):

- Context manager for editing a view's architecture using lxml.etree. - Usage: with util.editview(cr, 'module.viewid') as arch: ...

  • util.mergemodule(cr, oldname, into_name):

- Merges one module's metadata into another.

  • util.module_installed(cr, module):

- Returns True if the specified module is installed or being upgraded.

  • util.env(cr):

- Returns an odoo.api.Environment instance for the current cursor.

  • util.tableofmodel(cr, model):

- Returns the database table name associated with an Odoo model.

Best Practices

  • Pre-migration: Use for field and model renames so the new Odoo version can find the data during its own

installation.

  • Post-migration: Use for complex data transformations that require the new Odoo registry to be partially loaded.
  • Module discovery: Migration scripts should be placed in <module>/migrations/<target_ver>/.

For more details, consult the Odoo Upgrade Utils Documentation.