From 714bf1b0abf1bc81da3919b26a55a41dced899cc Mon Sep 17 00:00:00 2001 From: Olivier Colson Date: Mon, 5 Nov 2018 12:29:08 +0100 Subject: [PATCH] [FIX] account: reconcile each account only once when reversing an entry Before that, when reversing an account.move, if two lines of the move shared the same account, we tried reconciling them once for each line: it worked the first time but triggered an error message the second, since the lines had already been reconciled. --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 46e3b5f8855..febfdb77ac8 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -254,7 +254,7 @@ class AccountMove(models.Model): aml = ac_move.line_ids.filtered(lambda x: x.account_id.reconcile or x.account_id.internal_type == 'liquidity') aml.remove_move_reconcile() #reconcile together the reconciliable and the liquidity aml and their newly created counterpart - for account in [x.account_id for x in aml]: + for account in set([x.account_id for x in aml]): to_rec = aml.filtered(lambda y: y.account_id == account) to_rec |= reversed_move.line_ids.filtered(lambda y: y.account_id == account) to_rec.reconcile()