From 9352a8c433d60349a561980fe936ae686fcdda9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Taymans?= Date: Wed, 17 Apr 2024 15:33:21 +0200 Subject: [PATCH] [OU-IMP] project: merge project_status --- openupgrade_scripts/apriori.py | 2 ++ .../scripts/project/15.0.1.2/pre-migration.py | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 0e550954e9f7..d2ce33ef118e 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -113,3 +113,5 @@ "stock.inventory": "stock.quant", "stock.inventory.line": "stock.move.line", } + +merged_modules["project_status"] = "project" diff --git a/openupgrade_scripts/scripts/project/15.0.1.2/pre-migration.py b/openupgrade_scripts/scripts/project/15.0.1.2/pre-migration.py index 54558bdbb5d2..888f8d33405e 100644 --- a/openupgrade_scripts/scripts/project/15.0.1.2/pre-migration.py +++ b/openupgrade_scripts/scripts/project/15.0.1.2/pre-migration.py @@ -60,9 +60,32 @@ def adapt_project_task_dependency(env): ) +def migrate_project_status(env): + """Migrate project_status module if installed to + project.project.stages. + """ + if openupgrade.table_exists(env.cr, "project_status"): + openupgrade.rename_tables( + env.cr, + [("project_status", "project_project_stage")], + ) + openupgrade.rename_columns( + env.cr, + { + "project_project_stage": [ + ("company_id", None), + ("description", None), + ("status_sequence", "sequence"), + ("is_closed", None), + ], + }, + ) + + @openupgrade.migrate() def migrate(env, version): openupgrade.rename_columns(env.cr, _column_renames) adapt_project_task_dependency(env) fill_project_project_allow_task_dependencies(env) fill_project_project_last_update_status(env) + migrate_project_status(env)