Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project_status in standard since 15.0 but ported in 15.0 #1269

Open
remytms opened this issue Apr 18, 2024 · 1 comment
Open

project_status in standard since 15.0 but ported in 15.0 #1269

remytms opened this issue Apr 18, 2024 · 1 comment
Labels

Comments

@remytms
Copy link

remytms commented Apr 18, 2024

The module project_status brings statuses or stages on project.project. This has been added in standard (module project) since version 15.0 via project.project.stage.

The module project_status exists in 15.0 and seams to be refused into 16.0, see #1124.

This leads to difficulties form migrating database.

In OpenUpgrade, we can mark the module project_status as merged into project. The right place for doing that is in scripts in 15.0 version.

Doing the migration to standard in 15.0 is as simple as:

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.rename_columns(
        env.cr,
        {
            "project_project": [
                ("project_status", "stage_id"),
            ],
        },
    )

This script is tested and works.

But what to do with database in 15.0 that does not use the standard stages but the module project_status ?

Another solution is to mark the module project_status as merged in version 16.0 in OpenUpgrade (which is not correct, but match the state of the this repository). Then the script for migrating data will be a bit more complicated because tables already exists since version 15.0 so we need to copy data from tables to tables and update references.

Or we can do both.

I don't know whats the best approach. Personally, I'm not in the case of using project_status in 15.0, so I'm in favor of the simplest solution: migrating in 15.0.

@patrickrwilson as maintainer of project_status.

@pedrobaeza @legalsylvain I ping you because it's related to OpenUpgrade.

@remytms remytms added the bug label Apr 18, 2024
@pedrobaeza
Copy link
Member

You can add scripts in project module to detect if coming from a v14 having project_status installed and do whatever stuff you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants