Speed Improvement (removed inherit checks)

bzr revid: fp@tinyerp.com-20080716200951-lbzcbx5x2p7ibgzs
This commit is contained in:
Fabien Pinckaers
2008-07-16 22:09:51 +02:00
parent 694f88319c
commit fe7176aca3
+1 -10
View File
@@ -68,21 +68,12 @@ class osv_pool(netsvc.Service):
self.exportMethod(self.execute_cr)
def execute_cr(self, cr, uid, obj, method, *args, **kw):
#
# TODO: check security level
#
try:
object = pooler.get_pool(cr.dbname).get(obj)
if not object:
self.abortResponse(1, 'Object Error', 'warning',
'Object %s doesn\'t exist' % str(obj))
if (not method in getattr(object,'_protected')) and len(args) \
and args[0] and len(object._inherits):
object_t = pooler.get_pool(cr.dbname).get(obj)
res = getattr(object_t,method)(cr, uid, args, **kw)
else:
res = getattr(object,method)(cr, uid, *args, **kw)
return res
return getattr(object,method)(cr, uid, *args, **kw)
except orm.except_orm, inst:
self.abortResponse(1, inst.name, 'warning', inst.value)
except except_osv, inst: