From f8bbec56f278e8979459affb7b14e713b1d82b41 Mon Sep 17 00:00:00 2001 From: "Moises Lopez - https://www.vauxoo.com/" Date: Mon, 17 Jul 2023 22:15:41 +0000 Subject: [PATCH] [REF] core: Improve the message for invalid manifest version Considering the valid odoo version in the manifest version The message before of this commit was: Modules should have a version in format ``x.y`` or ``x.y.z`` It looks like it enforces to removing the odoo version part as invalid But it is not, in fact, it is already supported It is important since OCA enforces ``{odoo.version}.x.y.z`` format It was already discussed here: - https://github.com/odoo/odoo/pull/118420#issuecomment-1635047100 The message after this commit is: Modules should have a version in format `x.y`, `x.y.z`, `16.4.x.y` or `16.4.x.y.z`. Notice the Odoo version "16.4" is the current {odoo.version} for the moment this commit was done It avoid confusing about the valid formats to use closes odoo/odoo#128810 Signed-off-by: Christophe Simonis (chs) --- odoo/modules/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odoo/modules/module.py b/odoo/modules/module.py index 824eed7e16d..582330e685d 100644 --- a/odoo/modules/module.py +++ b/odoo/modules/module.py @@ -443,7 +443,8 @@ def adapt_version(version): base_version = version[len(serie) + 1:] if not re.match(r"^[0-9]+\.[0-9]+(?:\.[0-9]+)?$", base_version): - raise ValueError(f"Invalid version {base_version!r}. Modules should have a version in format `x.y` or `x.y.z`.") + raise ValueError(f"Invalid version {base_version!r}. Modules should have a version in format `x.y`, `x.y.z`," + f" `{serie}.x.y` or `{serie}.x.y.z`.") return version