mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]pms: reconcile bank statement
This commit is contained in:
@@ -50,14 +50,13 @@ class AccountBankStatement(models.Model):
|
||||
)
|
||||
payment_lines = self.env["account.move.line"].browse(
|
||||
to_reconcile_ids.ids
|
||||
)[0]
|
||||
)
|
||||
# We try to reconcile by amount
|
||||
payment_line = False
|
||||
for record in payment_lines:
|
||||
payment_line = (
|
||||
record if abs(record.balance) == line.amount else False
|
||||
)
|
||||
if not payment_line:
|
||||
payment_line = payment_lines[0]
|
||||
if payment_line and statement_move_line:
|
||||
statement_move_line.account_id = payment_line.account_id
|
||||
lines_to_reconcile = payment_line + statement_move_line
|
||||
|
||||
Reference in New Issue
Block a user