diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 14a3ac1534e6..000cdddbeaf8 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -88,6 +88,8 @@ # OCA/pos "pos_order_line_no_unlink": "point_of_sale", "pos_product_sort": "point_of_sale", + # OCA/project + "project_status": "project", # OCA/purchase-workflow "product_form_purchase_link": "purchase", # OCA/sale-promotion diff --git a/openupgrade_scripts/scripts/project/16.0.1.2/pre-migration.py b/openupgrade_scripts/scripts/project/16.0.1.2/pre-migration.py index 163f7e94956e..dea168105f89 100644 --- a/openupgrade_scripts/scripts/project/16.0.1.2/pre-migration.py +++ b/openupgrade_scripts/scripts/project/16.0.1.2/pre-migration.py @@ -155,6 +155,28 @@ def _fill_project_allow_milestones(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.add_fields(env, _new_fields) @@ -163,6 +185,7 @@ def migrate(env, version): _fill_project_last_update_status_if_null(env) _compute_project_task_ancestor_id(env) _compute_project_task_is_analytic_account_id_changed(env) + _migrate_project_status(env) # Remove SQL view project_task_burndown_chart_report not used anymore in Odoo v16.0 openupgrade.logged_query(