mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 02:31:21 +00:00
Merge pull request #52314 from aerele/fix/journal-entry-exchange-rate-type
fix(journal-entry): normalize exchange rate to float
This commit is contained in:
@@ -1691,6 +1691,10 @@ def get_exchange_rate(
|
|||||||
credit=None,
|
credit=None,
|
||||||
exchange_rate=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_details = frappe.get_cached_value(
|
||||||
"Account", account, ["account_type", "root_type", "account_currency", "company"], as_dict=1
|
"Account", account, ["account_type", "root_type", "account_currency", "company"], as_dict=1
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user