From e6bdc326e5f047de1d3071d419b14f529e8f18d5 Mon Sep 17 00:00:00 2001 From: Emilio Pascual Date: Mon, 24 Jun 2024 09:08:12 +0200 Subject: [PATCH] [FIX] base_comment_template: script pre-migration When upgrade odoo from old version, table `base_comment_template_ir_model_rel` does not exists. MT-6161 @moduon --- base_comment_template/migrations/16.0.1.1.0/pre-migration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base_comment_template/migrations/16.0.1.1.0/pre-migration.py b/base_comment_template/migrations/16.0.1.1.0/pre-migration.py index 89d9cbce40..a532707211 100644 --- a/base_comment_template/migrations/16.0.1.1.0/pre-migration.py +++ b/base_comment_template/migrations/16.0.1.1.0/pre-migration.py @@ -8,7 +8,9 @@ @openupgrade.migrate() def migrate(env, version): - if not column_exists(env.cr, "base_comment_template", "models"): + if openupgrade.table_exists( + env.cr, "base_comment_template_ir_model_rel" + ) and not column_exists(env.cr, "base_comment_template", "models"): openupgrade.logged_query( env.cr, "ALTER TABLE base_comment_template ADD COLUMN IF NOT EXISTS models text",