diff --git a/bin/addons/base/ir/ir_cron.py b/bin/addons/base/ir/ir_cron.py index 2eb3e83b344..7da956c36af 100644 --- a/bin/addons/base/ir/ir_cron.py +++ b/bin/addons/base/ir/ir_cron.py @@ -107,10 +107,8 @@ class ir_cron(osv.osv, netsvc.Agent): addsql = ', active=False' cr.execute("update ir_cron set nextcall=%s, numbercall=%s"+addsql+" where id=%s", (nextcall.strftime('%Y-%m-%d %H:%M:%S'), numbercall, job['id'])) cr.commit() - cr.commit() - except Exception,e: - cr.rollback() finally: + cr.commit() cr.close() # diff --git a/bin/sql_db.py b/bin/sql_db.py index 598e8be5e25..679ce2da7ac 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -159,6 +159,7 @@ class Cursor(object): @check def close(self): + self.rollback() # Ensure we close the current transaction. self.print_log() self._obj.close()