[FIX] account: reverse pair

Commit b6d4cd5deb 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
This commit is contained in:
Nicolas Martinelli
2018-03-29 11:47:36 +02:00
committed by Nicolas Martinelli
parent a52a6b865c
commit 1dbc655676
+1 -1
View File
@@ -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)