[FIX] put audittrail method in autocommit

bzr revid: christophe@tinyerp.com-20081122001401-axf7gw1zy566ttod
This commit is contained in:
Christophe Simonis 2008-11-22 01:14:01 +01:00
parent 0c75507f55
commit a76122fa34
1 changed files with 4 additions and 2 deletions

View File

@ -307,6 +307,7 @@ def tmp_fct(fct_src):
def execute( db, uid, passwd, object, method, *args):
pool = pooler.get_pool(db)
cr = pooler.get_db(db).cursor()
cr.autocommit(True)
obj=pool.get(object)
logged_uids = []
object_name=obj._name
@ -335,8 +336,7 @@ def tmp_fct(fct_src):
if getattr(thisrule, 'log_'+field):
return log_fct(db, uid, passwd, object, method, fct_src , *args)
return fct_src( db, uid, passwd, object, method, *args)
cr.commit()
res = my_fct( db, uid, passwd, object, method, *args)
res = my_fct( db, uid, passwd, object, method, *args)
cr.close()
return res
return execute
@ -344,4 +344,6 @@ def tmp_fct(fct_src):
obj = netsvc._service['object']
obj.execute = tmp_fct(obj.execute)
obj.exportMethod(obj.execute)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: