diff --git a/openerp/addons/base/ir/ir_http.py b/openerp/addons/base/ir/ir_http.py index 6f77f9fe86b..9fd485de57c 100644 --- a/openerp/addons/base/ir/ir_http.py +++ b/openerp/addons/base/ir/ir_http.py @@ -55,9 +55,6 @@ class ir_http(osv.AbstractModel): _description = "HTTP routing" - def __init__(self, registry, cr): - osv.osv.__init__(self, registry, cr) - def _find_handler(self): # TODO move to __init__(self, registry, cr) if not hasattr(self, 'routing_map'): diff --git a/openerp/http.py b/openerp/http.py index 0a0f135c935..a7964be6231 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -169,10 +169,12 @@ class WebRequest(object): # Backward for 7.0 if getattr(self.func, '_first_arg_is_req', False): args = (request,) + args - # TODO by chs - #@service_model.check - #def checked_call(dbname, *a, **kw): - # return func(*a, **kw) + # Correct exception handling and concurency retry + @service_model.check + def checked_call(dbname, *a, **kw): + return self.func(*a, **kw) + if self.db: + return checked_call(self.db, *args, **kwargs) return self.func(*args, **kwargs) finally: # just to be sure no one tries to re-use the request