mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[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
This commit is contained in:
@@ -8,7 +8,9 @@ from odoo.tools.sql import column_exists
|
||||
|
||||
@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",
|
||||
|
||||
Reference in New Issue
Block a user