From c2b684654ba503d972ca79d68f9b6c86a41aa636 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Fri, 24 Aug 2018 17:17:15 +0200 Subject: [PATCH] [FIX] account: unreconcile payment from invoice with exchange difference backport 1dbc65567604d85ce4cd5c663e8d9cdfd71316a4 Company in USD Invoice in EUR with rate A Register a payment in EUR with rate B Unreconcile them. Before this commit, there was an error because we tried to reconcile the exchange items with its reversal while the formers were already reconciled with the invoice After this commit, there is no error OPW 1864091 closes #26583 --- 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 0271807a235..a47de2d96e3 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -214,7 +214,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)