credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #05071
lp:~therp-nl/openupgrade-server/6.1-ir_model_data_delete_use_savepoints into lp:openupgrade-server
Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/openupgrade-server/6.1-ir_model_data_delete_use_savepoints into lp:openupgrade-server.
Requested reviews:
OpenUpgrade Committers (openupgrade-committers)
For more details, see:
https://code.launchpad.net/~therp-nl/openupgrade-server/6.1-ir_model_data_delete_use_savepoints/+merge/134707
--
https://code.launchpad.net/~therp-nl/openupgrade-server/6.1-ir_model_data_delete_use_savepoints/+merge/134707
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~therp-nl/openupgrade-server/6.1-ir_model_data_delete_use_savepoints into lp:openupgrade-server.
=== modified file 'openerp/addons/base/ir/ir_model.py'
--- openerp/addons/base/ir/ir_model.py 2012-06-24 08:26:23 +0000
+++ openerp/addons/base/ir/ir_model.py 2012-11-16 16:36:38 +0000
@@ -841,10 +841,11 @@
if self.pool.get(model):
_logger.info('Deleting %s@%s', res_id, model)
try:
+ cr.execute('SAVEPOINT ir_model_data_delete');
self.pool.get(model).unlink(cr, uid, [res_id])
- cr.commit()
+ cr.execute('RELEASE SAVEPOINT ir_model_data_delete');
except Exception:
- cr.rollback()
+ cr.execute('ROLLBACK TO SAVEPOINT ir_model_data_delete');
_logger.warning(
'Could not delete obsolete record with id: %d of model %s\n'
'There should be some relation that points to this resource\n'
Follow ups