From 65189ba09380e45d28e370b71e25fe8531087a07 Mon Sep 17 00:00:00 2001 From: AaronHForgeFlow Date: Mon, 15 Jan 2024 16:01:51 +0100 Subject: [PATCH] [FIX] project:post-migration: fill stage_id in projects is not correct --- .../project/15.0.1.2/post-migration.py | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/openupgrade_scripts/scripts/project/15.0.1.2/post-migration.py b/openupgrade_scripts/scripts/project/15.0.1.2/post-migration.py index 2d197c7b0a57..2050ec334272 100644 --- a/openupgrade_scripts/scripts/project/15.0.1.2/post-migration.py +++ b/openupgrade_scripts/scripts/project/15.0.1.2/post-migration.py @@ -69,32 +69,6 @@ def _fill_project_task_display_project_id(env): """, ) -def _fill_project_project_stage(env): - # use data from analytic_account_stage - env.cr.execute(""" - alter table account_analytic_account drop constraint if exists account_analytic_account_stage_id_fkey; - """) - env.cr.execute(""" - UPDATE project_project_stage SET active = false; - INSERT INTO project_project_stage - (create_date, write_date, sequence, name, fold, create_uid, write_uid, active) - SELECT create_date, write_date, sequence, name, fold, create_uid, write_uid, true - FROM analytic_account_stage; - """) - env.cr.execute(""" - WITH BQ AS( - SELECT pps.id as pps_id, aas.id as aas_id from project_project_stage pps - INNER JOIN analytic_account_stage aas on aas.name = pps.name - WHERE pps.name = aas.name - ) - UPDATE account_analytic_account aaa - SET stage_id = ( - SELECT BQ.pps_id - FROM account_analytic_account aaa2 - JOIN BQ ON BQ.aas_id = aaa2.stage_id - AND aaa.id = aaa2.id); - """) - @openupgrade.migrate() def migrate(env, version): @@ -111,5 +85,4 @@ def migrate(env, version): "mail_template_data_project_task", "rating_project_request_email_template", ], - ) - _fill_project_project_stage(env) + ) \ No newline at end of file