[IMP] core: formally deprecate __openerp__.py manifests.

`__manifest__.py` was introduced in Odoo 10 and quickly migrated
to (c758e9043a fixed the last holdouts).

Deprecate old manifests. People who need the compatibility can just
add a symlink (or duplicate the file if they're working on FAT or an
old os where core.symlinks can't be set to `true`).

closes odoo/odoo#103952

Signed-off-by: Raphael Collet <rco@odoo.com>
This commit is contained in:
Xavier Morel
2022-10-25 17:16:09 +02:00
parent 678c769706
commit e2b3463b5a
+10 -2
View File
@@ -316,8 +316,16 @@ def module_manifest(path):
if not path:
return None
for manifest_name in MANIFEST_NAMES:
if os.path.isfile(opj(path, manifest_name)):
return opj(path, manifest_name)
candidate = opj(path, manifest_name)
if os.path.isfile(candidate):
if manifest_name == '__openerp__.py':
warnings.warn(
"__openerp__.py manifests are deprecated since 17.0, "
f"rename {candidate!r} to __manifest__.py "
"(valid since 10.0)",
category=DeprecationWarning
)
return candidate
def get_module_root(path):
"""