Skip to content

[19.0][FIX] openupgrade_framework: survive fresh databases - #5954

Open
MiquelRForgeFlow wants to merge 2 commits into
OCA:19.0from
ForgeFlow:19.0-fix-openupgrade_framework-fresh-database
Open

[19.0][FIX] openupgrade_framework: survive fresh databases#5954
MiquelRForgeFlow wants to merge 2 commits into
OCA:19.0from
ForgeFlow:19.0-fix-openupgrade_framework-fresh-database

Conversation

@MiquelRForgeFlow

@MiquelRForgeFlow MiquelRForgeFlow commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The ir_model_fields#translate cleanup ran before the table exists: on a brand new database base_data.sql does not create it, the ORM does later on. Guard it with table_exists().

Forcing the upgrade scripts of every module in the graph also ran the module's own historical migration scripts for modules installed from scratch, where installed_version is empty and thus every version folder matches. Installing l10n_ch, l10n_in, l10n_nl, l10n_pl or l10n_sg failed on their 9.0 scripts, which import a function removed from account long ago. Keep only the OpenUpgrade scripts from upgrade_path for those modules.

Found doing manual analysis from fresh database for #5953.

…ases

The ir_model_fields#translate cleanup ran unconditionally in
_update_from_database, but on a brand new database that table does not exist
yet: base_data.sql does not create it, the ORM does later on while loading
base. Initializing a database with openupgrade_framework loaded aborted the
transaction with 'relation "ir_model_fields" does not exist'.
…h installs

The load_module_graph patch forces the upgrade scripts of every module in the
graph, which also brought in the module's own migrations/ and upgrades/
scripts for modules being installed from scratch. There installed_version is
empty, so every version folder compares as pending and all the historical
@MiquelRForgeFlow MiquelRForgeFlow added this to the 19.0 milestone Aug 28, 2026
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @StefanRijnhart, @legalsylvain, @hbrunn,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:19.0 mod:openupgrade_framework Module openupgrade_framework labels Aug 28, 2026

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you load openupgrade_framework during database installation in the first place?

for pkg in self.graph:
if pkg.load_state != "to upgrade" and pkg.name in self.migrations:
self.migrations[pkg.name]["module"] = {}
self.migrations[pkg.name]["module_upgrades"] = {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this break running migration script for newly installed dependencies?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:openupgrade_framework Module openupgrade_framework series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants