From 0bab2e7fbd1b39860f480dbb673814d380e2ad34 Mon Sep 17 00:00:00 2001
From: Christophe Monniez <moc@odoo.com>
Date: Wed, 20 Sep 2017 13:43:40 +0200
Subject: [PATCH] [FIX] modules: Verify that an addons path exists

---
 odoo/modules/module.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/odoo/modules/module.py b/odoo/modules/module.py
index b249f01c1d9b..586a43af69ed 100644
--- a/odoo/modules/module.py
+++ b/odoo/modules/module.py
@@ -139,13 +139,13 @@ def initialize_sys_path():
 
     # add base module path
     base_path = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'addons'))
-    if base_path not in ad_paths:
+    if base_path not in ad_paths and os.path.isdir(base_path):
         ad_paths.append(base_path)
 
     # add odoo.addons.__path__
     for ad in __import__('odoo.addons').addons.__path__:
         ad = os.path.abspath(ad)
-        if ad not in ad_paths:
+        if ad not in ad_paths and os.path.isdir(ad):
             ad_paths.append(ad)
 
     if not hooked:
-- 
GitLab