From 7759e2b25bfe5e330dccd0ed88e0bdc951654b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Taymans?= Date: Wed, 17 Apr 2024 11:58:52 +0200 Subject: [PATCH] [OU-IMP] project: merge project_milestone Parts of the project_milestone feature are merged into the `project` module and another part of the feature are moved to the `project_task_milestone` module. --- openupgrade_scripts/apriori.py | 1 + .../scripts/project/15.0.1.2/pre-migration.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 96bbf5491f1e..e91211ef0680 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -19,6 +19,7 @@ "website_sale_attribute_filter_order": "website_sale_product_attribute_filter_order", # OCA/project "project_category": "project_type", + "project_milestone": "project_task_milestone", "project_stage_state": "project_task_stage_state", "sale_project_service_tracking_copy_tasks": "sale_project_copy_tasks", # OCA/sale-promotion 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..8d086043db7d 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,22 @@ def adapt_project_task_dependency(env): ) +def rename_project_milestone_target_date(env): + """If project_milestone is installed then rename column target_date + to deadline. + """ + if openupgrade.column_exists(env.cr, "project_milestone", "target_date"): + openupgrade.rename_columns( + env.cr, + {"project_milestone": [("target_date", "deadline")]}, + ) + # TODO: activate milestone in configuration + + @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) + rename_project_milestone_target_date(env)