diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index bd4198a3..4b9bc95d 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -177,7 +177,7 @@ class CRMDeal(Document): system_currency = frappe.db.get_single_value("FCRM Settings", "currency") or "USD" exchange_rate = 1 if self.currency and self.currency != system_currency: - exchange_rate = get_exchange_rate(self.currency, system_currency, frappe.utils.nowdate()) + exchange_rate = get_exchange_rate(self.currency, system_currency) self.db_set("exchange_rate", exchange_rate) diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.py b/crm/fcrm/doctype/crm_organization/crm_organization.py index 1cdf186c..e528435c 100644 --- a/crm/fcrm/doctype/crm_organization/crm_organization.py +++ b/crm/fcrm/doctype/crm_organization/crm_organization.py @@ -16,7 +16,7 @@ class CRMOrganization(Document): system_currency = frappe.db.get_single_value("FCRM Settings", "currency") or "USD" exchange_rate = 1 if self.currency and self.currency != system_currency: - exchange_rate = get_exchange_rate(self.currency, system_currency, frappe.utils.nowdate()) + exchange_rate = get_exchange_rate(self.currency, system_currency) self.db_set("exchange_rate", exchange_rate) diff --git a/crm/utils/__init__.py b/crm/utils/__init__.py index eaf076d5..0e4582df 100644 --- a/crm/utils/__init__.py +++ b/crm/utils/__init__.py @@ -284,7 +284,7 @@ def get_exchange_rate(from_currency, to_currency, date=None): return rate frappe.log_error( - f"Failed to fetch exchange rate from {from_currency} to {to_currency} on {date}", title="Exchange Rate Fetch Error", + message=f"Failed to fetch exchange rate from {from_currency} to {to_currency} on {date}", ) return 1.0 # Default exchange rate if API call fails or no rate found