diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index b67ddaf2bd0..16efea06f13 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1115,7 +1115,7 @@ class DataSet(http.Controller): return self._call_kw(model, method, args, {}) @http.route(['/web/dataset/call_kw', '/web/dataset/call_kw/'], type='json', authentication="auth") - def call_kw(self, model, method, args, kwargs): + def call_kw(self, model, method, args, kwargs, path=None): return self._call_kw(model, method, args, kwargs) @http.route('/web/dataset/call_button', type='json', authentication="auth") diff --git a/addons/web/http.py b/addons/web/http.py index 83e1560501b..beac395c8a1 100644 --- a/addons/web/http.py +++ b/addons/web/http.py @@ -417,7 +417,7 @@ def jsonrequest(f): base = f.__name__ if f.__name__ == "index": base = "" - return route([base, os.path.join(base, "")], type="json", authentication="auth")(f) + return route([base, os.path.join(base, "")], type="json", authentication="auth")(f) class HttpRequest(WebRequest): """ Regular GET/POST request @@ -500,7 +500,7 @@ def httprequest(f): base = f.__name__ if f.__name__ == "index": base = "" - return route([base, os.path.join(base, "")], type="http", authentication="auth")(f) + return route([base, os.path.join(base, "")], type="http", authentication="auth")(f) #---------------------------------------------------------- # Local storage of requests @@ -865,9 +865,15 @@ class Root(object): """ path = request.httprequest.path urls = self.get_db_router(request.db).bind("") - func, original = urls.match(path)[0] + matched, arguments = urls.match(path) + arguments = dict([(k, v) for k, v in arguments.items() if not k.startswith("_ignored_")]) + func, original = matched - request.func = func + def nfunc(*args, **kwargs): + kwargs.update(arguments) + return func(*args, **kwargs) + + request.func = nfunc request.auth_method = getattr(original, "auth", "auth") request.func_request_type = original.exposed