openupgradelib
A library with support functions to be called from Odoo migration scripts.
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 openupgradelibuv
uv add openupgradelibpoetry
poetry add openupgradelibInstalling 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
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
odoo-test-helperProvides utilities for writing Odoo tests,…
copyleft · top 15,000 on PyPI
ERPpeekERPpeek is a command-line and library client…
permissive · top 15,000 on PyPI
clickhouse-migrationsApplies versioned SQL migrations to ClickHouse…
permissive · top 15,000 on PyPI
OdooRPCOdooRPC is a Python client library that…
copyleft · top 15,000 on PyPI
whoolwhool is a PEP 517 and PEP 660 compliant build…
permissive · top 15,000 on PyPI
setuptools-odooSetuptools-odoo automates packaging of Odoo…
copyleft · top 15,000 on PyPI
pytest-odoopytest-odoo is a pytest plugin that runs Odoo…
agpl · top 15,000 on PyPI
django-pg-zero-downtime-migrationsProvides a Django database backend for…
permissive · top 15,000 on PyPI
yoyo-migrationsYoyo-migrations is a database schema migration…
permissive · top 15,000 on PyPI
manifestoo-coreParses and reasons about Odoo addon manifests,…
permissive · top 15,000 on PyPI