Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Odoo Project Migration Data

Entity: odoo.project.module.migration

Compute Method: _compute_migration_script_ids

Inputs Method Outputs
for rec in self:
            version_model = rec.env["odoo.module.branch.version"]
            current_release_versions = version_model.search(
                [
                    ("module_branch_id", "=", rec.source_module_branch_id.id),
                    (
                        "sequence",
                        ">",
                        rec.project_module_id.installed_version_id.sequence,
                    ),
                    ("has_migration_script", "=", True),
                ],
                order="sequence",
            )
            # Collect versions with migration scripts accross next modules
            # taking into account module renaming/replacement
            target_branch = rec.migration_path_id.target_branch_id
            next_modules = rec.source_module_branch_id._get_next_module_branches(
                target_branch
            )
            new_release_versions = next_modules.version_ids.filtered(
                "has_migration_script"
            ).sorted(key=lambda v: (v.branch_sequence, v.sequence))
            rec.migration_script_ids = current_release_versions | new_release_versions

Back to entity