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

Module: Odoo Repository Migration Data

Entity: odoo.module.branch

Compute Method: _compute_migration_scan

Inputs Method Outputs
for rec in self:
            # Do not scan removed or pending (in PR) modules
            if rec.removed or rec.pr_url:
                rec.migration_scan = False
                continue
            # Default repository migration scan policy
            rec.migration_scan = rec.repository_id.collect_migration_data
            if not rec.migration_scan:
                continue
            # Repository scan has to be performed first
            if not rec.last_scanned_commit:
                continue
            # Migration scan to do as soon as a migration path is missing
            # among existing scans. However, we remove migration path that doesn't
            # match branches scanned in the repository (e.g. 18.0 branch could
            # be missing in a repo while a migration path 16.0 -> 18.0 is
            # configured, so no need to do a migration scan in this case).
            available_repo_branches = rec.repository_id.branch_ids.branch_id
            available_migration_paths = self.env["odoo.migration.path"].search(
                [
                    ("source_branch_id", "=", rec.branch_id.id),
                    ("target_branch_id", "in", available_repo_branches.ids),
                ]
            )
            scanned_migration_paths = rec.migration_ids.migration_path_id
            if available_migration_paths != scanned_migration_paths:
                rec.migration_scan = True
                continue
            # Migration scan to do if any of the migration path requires one
            rec.migration_scan = any(rec.migration_ids.mapped("migration_scan"))

Back to entity