From aae46b2b7c36e48902edc674ded5e0b3db6efc24 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Fri, 3 Jan 2025 14:01:50 +0100 Subject: [PATCH] [FIX] account_reconcile_oca: Update currency_amount --- .../models/account_bank_statement_line.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/account_reconcile_oca/models/account_bank_statement_line.py b/account_reconcile_oca/models/account_bank_statement_line.py index 9a68a1ea2..fbe274966 100644 --- a/account_reconcile_oca/models/account_bank_statement_line.py +++ b/account_reconcile_oca/models/account_bank_statement_line.py @@ -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] @@ -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",