From 3613935c5392fdcd02b72aedbaca0e70fc1d81e0 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 8 Feb 2011 14:27:19 +0100 Subject: [PATCH] [FIX] addons.__init__: make sure ad_paths is initialized before using it. bzr revid: vmt@openerp.com-20110208132719-qhlqqjkcyg3j9hv8 --- openerp/addons/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openerp/addons/__init__.py b/openerp/addons/__init__.py index 83f8db8acd2..af080724136 100644 --- a/openerp/addons/__init__.py +++ b/openerp/addons/__init__.py @@ -167,6 +167,7 @@ class Node(Singleton): def get_module_path(module, downloaded=False): """Return the path of the given module.""" + initialize_sys_path() for adp in ad_paths: if os.path.exists(opj(adp, module)) or os.path.exists(opj(adp, '%s.zip' % module)): return opj(adp, module) @@ -309,6 +310,7 @@ def get_modules(): return map(clean, filter(is_really_module, os.listdir(dir))) plist = [] + initialize_sys_path() for ad in ad_paths: plist.extend(listdir(ad)) return list(set(plist)) @@ -449,6 +451,7 @@ def register_class(m): logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: registering objects' % m) mod_path = get_module_path(m) + initialize_sys_path() try: zip_mod_path = mod_path + '.zip' if not os.path.isfile(zip_mod_path):