diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 9debaa7bcb9..6b1a28e5803 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -494,10 +494,6 @@ class Root(object): request.parameter_storage_class = werkzeug.datastructures.ImmutableDict request.app = self - if request.path == '/mobile': # FIXME move to web_mobile module - return werkzeug.utils.redirect( - '/web_mobile/static/src/web_mobile.html', 301)(environ, start_response) - handler = self.find_handler(*(request.path.split('/')[1:])) if not handler: diff --git a/addons/web_mobile/__init__.py b/addons/web_mobile/__init__.py index e69de29bb2d..ee5959455ad 100644 --- a/addons/web_mobile/__init__.py +++ b/addons/web_mobile/__init__.py @@ -0,0 +1 @@ +import controllers diff --git a/addons/web_mobile/controllers.py b/addons/web_mobile/controllers.py new file mode 100644 index 00000000000..2b12a178c15 --- /dev/null +++ b/addons/web_mobile/controllers.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +from openerp.addons.web.common import http as oeweb +import werkzeug + +class Mobile(oeweb.Controller): + _cp_path = '/mobile' + + @oeweb.httprequest + def index(self, req): + return werkzeug.utils.redirect('/web_mobile/static/src/web_mobile.html', 301)