[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) <chs@odoo.com>
This commit is contained in:
parent
d0de0d19c9
commit
f8bbec56f2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user