[FIX] point_of_sale: Don't reconcile already reconciled lines

At the closing of the POS, we try to reconcile
all lines involved in the closing.
If for any reason, a line is already reconciled
(I.E. Debit=0 and Credit=0 is considered as reconciled),
the closing fails because we cannot reconcile an already
reconciled line.

OPW-2602410

closes odoo/odoo#73783

X-original-commit: 4fd374b3f97eee1e706842ce1e28d0ad7a50315a
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
Jérôme Vanhaudenard
2021-07-15 14:20:10 +00:00
parent b290bceada
commit f63fed5caf
+1 -1
View File
@@ -753,7 +753,7 @@ class PosSession(models.Model):
| combine_cash_receivable_lines[statement]
)
accounts = all_lines.mapped('account_id')
lines_by_account = [all_lines.filtered(lambda l: l.account_id == account) for account in accounts]
lines_by_account = [all_lines.filtered(lambda l: l.account_id == account and not l.reconciled) for account in accounts]
for lines in lines_by_account:
lines.reconcile()
# We try to validate the statement after the reconciliation is done