system
July 29, 2021, 10:49am
1
Testing Site URL : https://gh-imp-2021-00412.castlecraft.co.in
Pull Request URL : https://github.com/frappe/erpnext/pull/26237
Pull Request Title : feat: Increase number of supported currency exchanges
Pull Request Description :
Switch from frankfurter.app to exchangerate.host to accommodate more currency usage.
Closes #25603
Credentials
username: ccunningham@riley.info
password: ee39ab3258
1 Like
@bluesky the site is ready, try with credentials.
1 Like
at Object.click (account__tree_js:158)
at HTMLButtonElement.<anonymous> (desk.bundle.53HS2ZU2.js:2885)
at HTMLButtonElement.dispatch (libs.bundle.7O6DCBW2.js:1)
at HTMLButtonElement.vt.handle (libs.bundle.7O6DCBW2.js:1)```
Got this error when creating a new account code with currency as USD
Created in List view and proceeded to get below message in Error Log. Trying to enter a TZS account expense to see if it calculates the exchange rate.
https://gh-imp-2021-00412.castlecraft.co.in/app/error-log/a95299ce21
Title
Get Exchange Rate
Error
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/utils.py", line 110, in get_exchange_rate
cache.setex(key, value, 6 * 60 * 60)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/redis/client.py", line 1822, in setex
return self.execute_command('SETEX', name, time, value)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/redis/client.py", line 901, in execute_command
return self.parse_response(conn, command_name, **options)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/redis/client.py", line 915, in parse_response
response = connection.read_response()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/redis/connection.py", line 756, in read_response
raise response
redis.exceptions.ResponseError: value is not an integer or out of range```
Thanks, @revant_one !
It seems the PR doesnât work and the correct exchange rate doesnât get fetched.
(No idea why the erpnext instance you set up is partially in German?! Tried to change the language to English but it didnât work)
One of the reason I was suggesting each user creates their own user on the PR Site.
Language can be set as per preference that way.
cache.setex()
had an issue.
Fixed in the latest commit. Works fine now.
1 Like
Checked it and the bug was fixed. Great PR @rtdany10 !
1 Like
Thank you!
Need to create some noise here to get one of the repo maintainer to review and give feedback or merge.
frappe:develop
â rtdany10:patch-5
opened 01:38PM - 28 Jun 21 UTC
Switch from frankfurter.app to exchangerate.host to accommodate more currency us⌠age.
Closes #25603
#no-docs
@nabinhait @gavindsouza @surajshetty
2 Likes
We got approved.
All the credits goes to Andreas Schlueter
opened 10:38AM - 06 May 21 UTC
closed 06:04AM - 31 Jul 21 UTC
feature-request
**Problem:**
Exchange rates are currently fetched from https://www.frankfurter.⌠app/. Unfortunately, this API only supports about 30-40 currencies with many world currencies still being not supported. This makes using a multi-currency setup very cumbersome to impossible to maintain if exchange rates have to be added manually.
**Proposed solution:**
There are other free APIs available that support more exchange rates. One promising API seems to be this one: https://exchangerate.host/
It is also free and open source (https://github.com/Formicka/exchangerate.host) and apparently supports 170 currencies (+ 6000 cryptocurrencies - not sure but might be also interesting for some ERPnext users?!).
It doesn't seem to be too complicated to adjust the current code to support. Unfortunately, I am hosting my instance on frappe.cloud, so I don't have the option to work on the code.
In [erpnext/setup/utils.py (L101)](https://github.com/frappe/erpnext/blob/5ce0569f80c622d6d7ff480015e8d79b82bf93b5/erpnext/setup/utils.py#L101) the frankfurter.app API is currently called. It seems one would only need to adjust the API call and link to exchangerate.host and this would directly add >100 additional currencies supported by ERPnext (+many cryptocurrencies).
It would be amazing if someone from the core team could test this. It doesn't seem to be a hard fix.
**Potential alternatives**
Potentially, ERPnext could allow the user to specify the API (and its settings) similar to how it is currently available for SMS APIs (https://docs.erpnext.com/docs/user/manual/en/setting-up/sms-setting). This might be a little bit more work, but would make multi-currency support even more flexible. If the core team wishes to have frankfurter.app still as default, this could be left as a default value. However this way, the user could change to the API they wish to use and could also use a commercial API (such as fixer.io) if they need/want.
**Additional context**
This issue has been raised already quite some time ago in this thread in the Forum:
https://discuss.erpnext.com/t/is-there-any-plan-for-the-missing-exchange-rates-on-www-frankfurter-app/48782
I believe many companies especially in developing countries with lesser known currencies, that are currently unsupported by the frankfurter.app, would benefit from this.
1 Like