[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user