fix: use frankfurter v2 by default for new install

(cherry picked from commit 479f9f63c9)
This commit is contained in:
diptanilsaha
2026-06-09 12:17:18 +05:30
committed by Mergify
parent 70628c06c9
commit d62985d9a7

View File

@@ -90,14 +90,7 @@ def set_single_defaults():
def setup_currency_exchange():
ces = frappe.get_single("Currency Exchange Settings")
try:
ces.set("result_key", [])
ces.set("req_params", [])
ces.api_endpoint = "https://api.frankfurter.dev/v1/{transaction_date}"
ces.append("result_key", {"key": "rates"})
ces.append("result_key", {"key": "{to_currency}"})
ces.append("req_params", {"key": "base", "value": "{from_currency}"})
ces.append("req_params", {"key": "symbols", "value": "{to_currency}"})
ces.service_provider = "frankfurter.dev - v2"
ces.save()
except frappe.ValidationError:
pass