[FIX]: fix odoo_version detection

Right now if the version is not "final (and not alpha)"
documentation will say 16.0beta != 16.0

closes odoo/documentation#2748

X-original-commit: 406f3aac18
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This commit is contained in:
Xavier-Do 2022-09-21 08:03:31 +00:00
parent 2c7d61f938
commit 53e7277b6a

View File

@ -95,7 +95,7 @@ else:
import odoo.addons
odoo.addons.__path__.append(str(odoo_dir) + '/addons')
from odoo import release as odoo_release # Don't collide with Sphinx's 'release' config option
odoo_version = odoo_release.version.replace('~', '-') # Change saas~XX.Y to saas-XX.Y
odoo_version = '.'.join(str(s) for s in odoo_release.version_info[:2]).replace('~', '-') # Change saas~XX.Y to saas-XX.Y
odoo_version = 'master' if 'alpha' in odoo_release.version else odoo_version
if release != odoo_version:
_logger.warning(