From 3f0032d7930e846c8f998ed0b3d46ef83ea3f771 Mon Sep 17 00:00:00 2001 From: Dharanidharan2813 Date: Mon, 2 Feb 2026 22:53:00 +0530 Subject: [PATCH] fix(journal-entry): normalize exchange rate to float (cherry picked from commit be0040ddc7dab48d6edfd9a465a053a657746858) --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 4ea077f5d8c..dd37c82af0e 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -1691,6 +1691,10 @@ def get_exchange_rate( credit=None, exchange_rate=None, ): + # Ensure exchange_rate is always numeric to avoid calculation errors + if isinstance(exchange_rate, str): + exchange_rate = flt(exchange_rate) or 1 + account_details = frappe.get_cached_value( "Account", account, ["account_type", "root_type", "account_currency", "company"], as_dict=1 )