[FIX] core: ensure odoo.upgrade __path__ contains real directories

mimic what is done for `odoo.addons` __path__.

closes odoo/odoo#121211

X-original-commit: 2a981e6a561f572742202d9c964d3b1f3aecacf9
Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit is contained in:
Christophe Simonis
2023-05-11 19:21:14 +02:00
parent b3b8dbb858
commit 0a159622c2
+1 -1
View File
@@ -114,7 +114,7 @@ def initialize_sys_path():
legacy_upgrade_path = os.path.join(base_path, 'base', 'maintenance', 'migrations')
for up in (tools.config['upgrade_path'] or legacy_upgrade_path).split(','):
up = os.path.normcase(os.path.abspath(tools.ustr(up.strip())))
if up not in upgrade.__path__:
if os.path.isdir(up) and up not in upgrade.__path__:
upgrade.__path__.append(up)
# create decrecated module alias from odoo.addons.base.maintenance.migrations to odoo.upgrade