← Back to team overview

banking-addons-team team mailing list archive

lp:~camptocamp/banking-addons/already_delete_reconcile_id_resubmit into lp:banking-addons/bank-statement-reconcile-7.0

 

Vincent Renaville@camptocamp has proposed merging lp:~camptocamp/banking-addons/already_delete_reconcile_id_resubmit into lp:banking-addons/bank-statement-reconcile-7.0.

Requested reviews:
  Guewen Baconnier @ Camptocamp (gbaconnier-c2c)
Related bugs:
  Bug #1250073 in Banking Addons: "remove an account.move with reconcile"
  https://bugs.launchpad.net/banking-addons/+bug/1250073

For more details, see:
https://code.launchpad.net/~camptocamp/banking-addons/already_delete_reconcile_id_resubmit/+merge/194679

[FIX] remove account.reconcile before deleting a account.move
-- 
https://code.launchpad.net/~camptocamp/banking-addons/already_delete_reconcile_id_resubmit/+merge/194679
Your team Banking Addons Core Editors is subscribed to branch lp:banking-addons/bank-statement-reconcile-7.0.
=== modified file 'account_statement_ext/account.py'
--- account_statement_ext/account.py	2012-12-20 13:37:01 +0000
+++ account_statement_ext/account.py	2013-11-11 12:34:25 +0000
@@ -31,8 +31,11 @@
         Delete the reconciliation when we delete the moves. This
         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_line in move.line_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)


Follow ups