mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
feat: Increase number of supported currency exchanges
Switch from frankfurter.app to exchangerate.host to accomodate more currency usage. Closes #25603
This commit is contained in:
@@ -98,10 +98,10 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
|
|||||||
|
|
||||||
if not value:
|
if not value:
|
||||||
import requests
|
import requests
|
||||||
api_url = "https://frankfurter.app/{0}".format(transaction_date)
|
api_url = "https://api.exchangerate.host/latest"
|
||||||
response = requests.get(api_url, params={
|
response = requests.get(api_url, params={
|
||||||
"base": from_currency,
|
"symbols": from_currency+","+to_currency,
|
||||||
"symbols": to_currency
|
"base": from_currency
|
||||||
})
|
})
|
||||||
# expire in 6 hours
|
# expire in 6 hours
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|||||||
Reference in New Issue
Block a user