From 1dbc65567604d85ce4cd5c663e8d9cdfd71316a4 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 28 Mar 2018 12:46:30 +0200 Subject: [PATCH] [FIX] account: reverse pair Commit b6d4cd5deb319c9 introduced the auto-reconciliation when reversing an entry. However, we should make sure to only reconcile non-reconciled entries. Such an entry can be generated from an exchange rate entry. opw-1826024 --- 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 9933a91270e..5df5f1c93c7 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -220,7 +220,7 @@ class AccountMove(models.Model): # Do not forward port in >= saas-14 def _reconcile_reversed_pair(self, move, reversed_move): - amls_to_reconcile = move.line_ids + reversed_move.line_ids + amls_to_reconcile = (move.line_ids + reversed_move.line_ids).filtered(lambda l: not l.reconciled) accounts_reconcilable = amls_to_reconcile.mapped('account_id').filtered(lambda a: a.reconcile) for account in accounts_reconcilable: amls_for_account = amls_to_reconcile.filtered(lambda l: l.account_id.id == account.id)