[FIX] account: unreconcile payment from invoice with exchange difference

backport 1dbc655676

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
This commit is contained in:
Lucas Perais (lpe)
2018-08-27 10:26:39 +02:00
parent 81f975d3f4
commit c2b684654b
+1 -1
View File
@@ -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)