mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] account_reconcile_oca : max_amount rounding error leading to unwanted currency conversion
This commit is contained in:
committed by
Enric Tobella
parent
cd165e299d
commit
66f5f3a8de
@@ -214,11 +214,10 @@ class AccountBankStatementLine(models.Model):
|
||||
new_data = []
|
||||
is_new_line = True
|
||||
pending_amount = 0.0
|
||||
currency = self._get_reconcile_currency()
|
||||
for line in data:
|
||||
if line["kind"] != "suspense":
|
||||
pending_amount += self._get_amount_currency(
|
||||
line, self._get_reconcile_currency()
|
||||
)
|
||||
pending_amount += self._get_amount_currency(line, currency)
|
||||
if self.add_account_move_line_id.id in line.get(
|
||||
"counterpart_line_ids", []
|
||||
):
|
||||
@@ -230,7 +229,7 @@ class AccountBankStatementLine(models.Model):
|
||||
self.add_account_move_line_id,
|
||||
"other",
|
||||
True,
|
||||
max_amount=pending_amount,
|
||||
max_amount=currency.round(pending_amount),
|
||||
move=True,
|
||||
)
|
||||
new_data += lines
|
||||
|
||||
Reference in New Issue
Block a user