Skip to content

Commit

Permalink
[FIX] account_reconcile_oca: Update currency_amount
Browse files Browse the repository at this point in the history
  • Loading branch information
etobella committed Jan 3, 2025
1 parent 9ec53e1 commit f0ae2f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions account_reconcile_oca/models/account_account_reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def _recompute_data(self, data):
lines = self._get_reconcile_line(
self.env["account.move.line"].browse(line_id),
"other",
True,
max_amount,
is_counterpart=True,
max_amount=max_amount,
move=True,
)
new_data["data"] += lines
Expand Down
16 changes: 14 additions & 2 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _onchange_add_account_move_line_id(self):
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,
)
Expand Down Expand Up @@ -429,7 +429,7 @@ def _onchange_manual_amount_in_currency(self):
self._onchange_manual_reconcile_vals()

def _get_manual_reconcile_vals(self):
return {
vals = {
"name": self.manual_name,
"partner_id": self.manual_partner_id
and self.manual_partner_id.name_get()[0]
Expand All @@ -442,6 +442,18 @@ def _get_manual_reconcile_vals(self):
"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",
Expand Down

0 comments on commit f0ae2f0

Please sign in to comment.