[FIX] account_reconcile_oca: Update currency_amount

pull/808/head
Enric Tobella 2025-01-03 14:01:50 +01:00 committed by Jordi Ballester Alomar
parent 4fe0125cc9
commit 20f60cfe62
1 changed files with 14 additions and 2 deletions

View File

@ -212,7 +212,7 @@ class AccountBankStatementLine(models.Model):
reconcile_auxiliary_id, lines = self._get_reconcile_line(
self.add_account_move_line_id,
"other",
True,
is_counterpart=True,
max_amount=currency.round(pending_amount),
move=True,
)
@ -416,7 +416,7 @@ class AccountBankStatementLine(models.Model):
self._onchange_manual_reconcile_vals()
def _get_manual_reconcile_vals(self):
return {
vals = {
"name": self.manual_name,
"partner_id": (
self.manual_partner_id
@ -434,6 +434,18 @@ class AccountBankStatementLine(models.Model):
"debit": self.manual_amount if self.manual_amount > 0 else 0.0,
"analytic_distribution": self.analytic_distribution,
}
if self.manual_line_id:
vals.update(
{
"currency_amount": self.manual_line_id.currency_id._convert(
self.manual_amount,
self.manual_in_currency_id,
self.company_id,
self.manual_line_id.date,
),
}
)
return vals
@api.onchange(
"manual_account_id",