Merge pull request #52377 from frappe/mergify/bp/version-16-hotfix/pr-52314

fix(journal-entry): normalize exchange rate to float (backport #52314)
This commit is contained in:
ruthra kumar
2026-02-03 20:10:03 +05:30
committed by GitHub

View File

@@ -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
)