|
|
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
|
|