From e2b3463b5afa10bd7d1f68fc4b7602925242e06d Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 24 Oct 2022 13:28:56 +0000 Subject: [PATCH] [IMP] core: formally deprecate __openerp__.py manifests. `__manifest__.py` was introduced in Odoo 10 and quickly migrated to (c758e9043aef8585934e847560ece622a1ca6443 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 --- odoo/modules/module.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/odoo/modules/module.py b/odoo/modules/module.py index 9a2f7fcdbdd..d1740f7d045 100644 --- a/odoo/modules/module.py +++ b/odoo/modules/module.py @@ -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): """