From 8a562581ba4edf9da9f67db240f556845e4a799a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 7 Sep 2024 15:54:40 +0200 Subject: [PATCH] [FIX] donation_stay: fix migration script Avoid crash when migrating directly from 10.0 to 14.0.2.0.0 --- donation_stay/migrations/14.0.2.0.0/pre-migration.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/donation_stay/migrations/14.0.2.0.0/pre-migration.py b/donation_stay/migrations/14.0.2.0.0/pre-migration.py index 30fbb44..edb6e43 100644 --- a/donation_stay/migrations/14.0.2.0.0/pre-migration.py +++ b/donation_stay/migrations/14.0.2.0.0/pre-migration.py @@ -11,4 +11,7 @@ @openupgrade.migrate() def migrate(env, version): - openupgrade.rename_columns(env.cr, _column_renames) + # The column donation_id doesn't exist on stay_stay if you upgrade + # directly from 10.0 to 14.0.2.0.0 + if openupgrade.column_exists(env.cr, "stay_stay", "donation_id"): + openupgrade.rename_columns(env.cr, _column_renames)