mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] remove account.reconcile before deleting a account.move
This commit is contained in:
@@ -31,8 +31,11 @@ class account_move(Model):
|
|||||||
Delete the reconciliation when we delete the moves. This
|
Delete the reconciliation when we delete the moves. This
|
||||||
allow an easier way of cancelling the bank statement.
|
allow an easier way of cancelling the bank statement.
|
||||||
"""
|
"""
|
||||||
|
reconcile_to_delete = []
|
||||||
|
reconcile_obj = self.pool.get('account.move.reconcile')
|
||||||
for move in self.browse(cr, uid, ids, context=context):
|
for move in self.browse(cr, uid, ids, context=context):
|
||||||
for move_line in move.line_id:
|
for move_line in move.line_id:
|
||||||
if move_line.reconcile_id:
|
if move_line.reconcile_id:
|
||||||
move_line.reconcile_id.unlink(context=context)
|
reconcile_to_delete.append(move_line.reconcile_id.id)
|
||||||
|
reconcile_obj.unlink(cr,uid,reconcile_to_delete,context=context)
|
||||||
return super(account_move, self).unlink(cr, uid, ids, context=context)
|
return super(account_move, self).unlink(cr, uid, ids, context=context)
|
||||||
|
|||||||
Reference in New Issue
Block a user