summaryrefslogtreecommitdiff
path: root/addons/web/common/http.py
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2012-09-02 19:05:56 +0200
committerAntony Lesuisse <al@openerp.com>2012-09-02 19:05:56 +0200
commit1699e4dc97f4472dee01852dcd131f60d1817771 (patch)
tree17af36657c372b9c10b64dce97bd31695e1f72e6 /addons/web/common/http.py
parentd7a2ea78dc50f17813e2d20712c146a427dece0b (diff)
[IMP] determine openerp_addons_namespace dynamically
bzr revid: al@openerp.com-20120902170556-vkt2a936am4vrmmc
Diffstat (limited to 'addons/web/common/http.py')
-rw-r--r--addons/web/common/http.py8
1 files changed, 4 insertions, 4 deletions
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)