[FIX] account_reconcile_oca : max_amount rounding error leading to unwanted currency conversion
parent
bf6e1d23a0
commit
829299dffe
|
@ -198,11 +198,10 @@ class AccountBankStatementLine(models.Model):
|
||||||
new_data = []
|
new_data = []
|
||||||
is_new_line = True
|
is_new_line = True
|
||||||
pending_amount = 0.0
|
pending_amount = 0.0
|
||||||
|
currency = self._get_reconcile_currency()
|
||||||
for line in data:
|
for line in data:
|
||||||
if line["kind"] != "suspense":
|
if line["kind"] != "suspense":
|
||||||
pending_amount += self._get_amount_currency(
|
pending_amount += self._get_amount_currency(line, currency)
|
||||||
line, self._get_reconcile_currency()
|
|
||||||
)
|
|
||||||
if self.add_account_move_line_id.id in line.get(
|
if self.add_account_move_line_id.id in line.get(
|
||||||
"counterpart_line_ids", []
|
"counterpart_line_ids", []
|
||||||
):
|
):
|
||||||
|
@ -214,7 +213,7 @@ class AccountBankStatementLine(models.Model):
|
||||||
self.add_account_move_line_id,
|
self.add_account_move_line_id,
|
||||||
"other",
|
"other",
|
||||||
True,
|
True,
|
||||||
max_amount=pending_amount,
|
max_amount=currency.round(pending_amount),
|
||||||
move=True,
|
move=True,
|
||||||
)
|
)
|
||||||
new_data += lines
|
new_data += lines
|
||||||
|
|
Loading…
Reference in New Issue