Skip to content

Commit

Permalink
[FIX] account_reconcile_oca : max_amount rounding error leading to un…
Browse files Browse the repository at this point in the history
…wanted currency conversion
  • Loading branch information
florian-dacosta authored and etobella committed Nov 16, 2024
1 parent c810817 commit 95645d2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,10 @@ def _onchange_add_account_move_line_id(self):
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", []
):
Expand All @@ -230,7 +229,7 @@ def _onchange_add_account_move_line_id(self):
self.add_account_move_line_id,
"other",
True,
max_amount=pending_amount,
max_amount=currency.round(pending_amount),
move=True,
)
new_data += lines
Expand Down

0 comments on commit 95645d2

Please sign in to comment.