diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 9c3664c8da0..6dc99f2c997 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -461,7 +461,7 @@ class Root(object): only used in case the list of databases is requested by the server, will be filtered by this pattern """ - def __init__(self, options, openerp_addons_namespace=True): + def __init__(self, options): self.config = options if not hasattr(self.config, 'connector'): @@ -474,7 +474,7 @@ class Root(object): self.httpsession_cookie = 'httpsessionid' self.addons = {} - static_dirs = self._load_addons(openerp_addons_namespace) + static_dirs = self._load_addons() if options.serve_static: app = werkzeug.wsgi.SharedDataMiddleware( self.dispatch, static_dirs) self.dispatch = DisableCacheMiddleware(app) @@ -520,7 +520,7 @@ class Root(object): return response(environ, start_response) - def _load_addons(self, openerp_addons_namespace=True): + def _load_addons(self): """ Loads all addons at the specified addons path, returns a mapping of static URLs to the corresponding directories @@ -535,7 +535,7 @@ class Root(object): manifest = ast.literal_eval(open(manifest_path).read()) manifest['addons_path'] = addons_path _logger.debug("Loading %s", module) - if openerp_addons_namespace: + if 'openerp.addons' in sys.modules: m = __import__('openerp.addons.' + module) else: m = __import__(module) diff --git a/openerp-web b/openerp-web index 3340b95646e..7e536a99442 100755 --- a/openerp-web +++ b/openerp-web @@ -105,7 +105,7 @@ if __name__ == "__main__": else: logging.basicConfig(level=getattr(logging, options.log_level.upper())) - app = web.common.http.Root(options, openerp_addons_namespace=False) + app = web.common.http.Root(options) if options.proxy_mode: app = werkzeug.contrib.fixers.ProxyFix(app)