From 5a69423677b870c0990f3a1cf307efeee3e0dd2b Mon Sep 17 00:00:00 2001
From: Christophe Simonis <chs@odoo.com>
Date: Wed, 10 May 2023 13:36:06 +0000
Subject: [PATCH] [FIX] core: ensure `odoo.upgrade` __path__ contains real
 directories

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

closes odoo/odoo#121147

X-original-commit: 2a981e6a561f572742202d9c964d3b1f3aecacf9
Signed-off-by: Christophe Simonis <chs@odoo.com>
---
 odoo/modules/module.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/odoo/modules/module.py b/odoo/modules/module.py
index 282c95b02ebc..1b72e425c0e6 100644
--- a/odoo/modules/module.py
+++ b/odoo/modules/module.py
@@ -140,7 +140,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
-- 
GitLab