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

Entity: odoo.project.module

Compute Method: _compute_installed_version_id

View 18.0
Inputs Method Outputs
  • version_ids
  • installed_version
  • name
+ for rec in self:
+             rec.installed_version_id = rec.version_ids.browse()
+             if not rec.installed_version:
+                 continue
+             # Installed version could not be available in inventoried versions
+             # if it is coming from a pending-merge. In such case we take the
+             # nearest version matching the installed one.
+             #   - Available versions upstream = "14.0.2.0.0" & "14.0.2.1.0"
+             #   - Installed version  = "14.0.2.0.1" (in a pending-merge)
+             #   - Computed installed version = "14.0.2.0.0"
+             inst_ver = [int(n) for n in rec.installed_version.split(".")]
+             for version in rec.version_ids.sorted("sequence"):
+                 ver = [int(n) for n in version.name.split(".")]
+                 if ver > inst_ver:
+                     break
+                 rec.installed_version_id = version
  • installed_version_id

Back to entity