Skip to content

manifest-behind-migrations (ODOO054)

Preview (since 0.16.2.8) · Related issues · View source

Derived from the odoo linter.

This rule is unstable and in preview. The --preview flag is required for use.

What it does

Checks that the version in an Odoo module's __manifest__.py is not lower than the version of any migration script directory under the module's migrations/ folder.

Why is this bad?

Odoo only runs a migration script when the module is upgraded to a version greater than or equal to the script's version. If the manifest version stays behind the migration script's version, the migration script never runs.

Example

# migrations/18.0.1.0.1/pre-migration.py exists
{
    "name": "My Module",
    "version": "18.0.1.0.0",
}

Use instead:

# migrations/18.0.1.0.1/pre-migration.py exists
{
    "name": "My Module",
    "version": "18.0.1.0.1",
}