[FIX] account_reconcile_oca: Update currency_amount

pull/694/head
Enric Tobella 2025-01-03 14:01:50 +01:00
parent 9ec53e169d
commit f0ae2f00ac
2 changed files with 16 additions and 4 deletions

View File

@ -166,8 +166,8 @@ class AccountAccountReconcile(models.Model):
lines = self._get_reconcile_line( lines = self._get_reconcile_line(
self.env["account.move.line"].browse(line_id), self.env["account.move.line"].browse(line_id),
"other", "other",
True, is_counterpart=True,
max_amount, max_amount=max_amount,
move=True, move=True,
) )
new_data["data"] += lines new_data["data"] += lines

View File

@ -228,7 +228,7 @@ class AccountBankStatementLine(models.Model):
reconcile_auxiliary_id, lines = self._get_reconcile_line( reconcile_auxiliary_id, lines = self._get_reconcile_line(
self.add_account_move_line_id, self.add_account_move_line_id,
"other", "other",
True, is_counterpart=True,
max_amount=currency.round(pending_amount), max_amount=currency.round(pending_amount),
move=True, move=True,
) )
@ -429,7 +429,7 @@ class AccountBankStatementLine(models.Model):
self._onchange_manual_reconcile_vals() self._onchange_manual_reconcile_vals()
def _get_manual_reconcile_vals(self): def _get_manual_reconcile_vals(self):
return { vals = {
"name": self.manual_name, "name": self.manual_name,
"partner_id": self.manual_partner_id "partner_id": self.manual_partner_id
and self.manual_partner_id.name_get()[0] and self.manual_partner_id.name_get()[0]
@ -442,6 +442,18 @@ class AccountBankStatementLine(models.Model):
"debit": self.manual_amount if self.manual_amount > 0 else 0.0, "debit": self.manual_amount if self.manual_amount > 0 else 0.0,
"analytic_distribution": self.analytic_distribution, "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( @api.onchange(
"manual_account_id", "manual_account_id",