Skip to content

Commit

Permalink
[OU-IMP] project: add project_status migration
Browse files Browse the repository at this point in the history
  • Loading branch information
remytms committed Apr 17, 2024
1 parent a0f2db1 commit 9928b09
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openupgrade_scripts/apriori.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions openupgrade_scripts/scripts/project/16.0.1.2/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down

0 comments on commit 9928b09

Please sign in to comment.