skillfed

openupgradelib

A library with support functions to be called from Odoo migration scripts.

openupgradelib v3.13.6 279.0K downloads/30d#8,126 on PyPI106
AGPL license AGPL-3 Active released

What it is and what it does

OpenUpgradeLib is a support library for writing Odoo database migration scripts. It provides a collection of helper functions to safely perform common upgrade tasks: merging records while preserving foreign key integrity, renaming models and fields across the database, updating XML definitions, converting field types, and managing module reorganizations. The library handles both ORM and direct SQL approaches depending on the operation and dataset size.

It depends on lxml, cssselect, and importlib_metadata for XML parsing and field introspection. The package is maintained by the Odoo Community Association and is actively used in production Odoo upgrades. It abstracts away low-level database manipulation and XML handling so migration script authors can focus on business logic rather than SQL correctness.

Use it for:

  • Merge duplicate customer or product records during an Odoo version upgrade while maintaining referential integrity.
  • Rename a model across the entire database and update all XML IDs, properties, and foreign key references automatically.
  • Convert a binary field to an attachment-based storage during a major version migration.
  • Update module field locations when refactoring Odoo module structure across versions.
  • Transform XML view definitions from Bootstrap 3 to Bootstrap 4 during an upgrade.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides utility functions for Odoo database migrations, including record merging, field renaming, model updates, and XML transformations to support version upgrades.

Yes, if you are writing Odoo migration scripts. The library is actively maintained, has no known vulnerabilities, and solves real problems in Odoo upgrades that would otherwise require manual SQL and XML manipulation. The AGPL-3 license is standard for Odoo ecosystem tools. Install only if you are performing Odoo version upgrades; it has no use outside that context.

Install

openupgradelib on PyPI

pip

pip install openupgradelib

uv

uv add openupgradelib

poetry

poetry add openupgradelib

Installing openupgradelib

Before you install

Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release (9 days old) and steady commit activity. Supports Python 2.7 and Python 3.5 through 3.9.

License in practice

Licensed under AGPL-3, which requires that any modifications or derivative works must also be distributed under AGPL-3 and source code must be made available to users. This is a strong copyleft license suitable for internal tools but restrictive for proprietary software.

Quickstart

pip install openupgradelib

from openupgradelib import openupgrade

# Example: merge records
openupgrade.merge_records(env, 'model.name', [record_ids], target_id)

Requires an active Odoo environment (env) to be passed; designed to run within Odoo migration scripts, not as a standalone tool.

Verify before relying

  • Whether the package works with Odoo versions released after 2026-08-05 or has version-specific constraints not listed in classifiers.
  • Performance characteristics when merging large datasets or handling complex many-to-many relationships.
  • Exact scope of XML transformation capabilities beyond Bootstrap 3-to-4 conversion mentioned in history.

Package facts

License AGPL-3 (agpl)
Python support supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7)
Install friction low — pure-Python wheel
Runtime dependencies 3 — lxml, cssselect, importlib_metadata
Maintenance actively maintained — 9 days since the last release
Last repo commit
First released
Downloads 279,022/month — #8,126 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openupgradelib-3.13.6-py2.py3-none-any.whl

Keywords: openupgradelib

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Affero General Public License v3Natural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

odoo migration utilitiesdatabase record mergingodoo upgrade scriptsfield renaming toolsodoo xml transformation
odoo-ecosystemdatabase-migration

More Database packages