-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Many unsupported exchange rates: Switch from frankfurter.app to exchangerate.host or allow custom API #25603
Comments
The code in erpnext/setup/utils.py (L101) needs to be changed from
to
I tested several currencies(incl. crypto-currencies), which are currently unsupported by frankfurter.app, and it works now with the new API (exchangerate.host). |
@aschl i have a v13 test instance running, if you detail me a bit more what I shall test I can give it a try. |
Switch from frankfurter.app to exchangerate.host to accomodate more currency usage. Closes frappe#25603
This is a neccesary change to be done |
I think a few transactions in different currencies using the new API on ERPnext would be sufficient to check whether the API is called correctly. As long as the API call works and the numbers are retrieved correctly, everything should work properly IMHO. (In fact the suggested code is mostly a change in the link that is called and small adjustments how the rate is extracted, so no magic...) |
Let me try to do a PR, since it's a change in the URL only. Even if we bring in crypto as a 2nd stage change, it's fine. One change at a time. |
I have already send a PR regarding the same. PR #25722. |
Weird, its not working for me I think I've pasted my code right
|
@dawoodjee Hope you restarted the bench after you made changes. Also, try digging into the exact error raised by the try-catch. |
I did restart, I'm using v13, isnt it just suppose to work on mine the way its working on your server? I'll do some troubleshooting, thanks for the pointers. |
Hi @aakvatech, can you have a look at the PRs #25722 and #26237 respectively? I am confused where the PR is stuck and what needs to be done. This PR is open since more than two months and I'm not sure why it's not getting merged. Happy to help out somewhere if you or someone else gives me guidance what needs to be fixed to get this finally merged. Thank you very much! |
We got approved #26237 |
You can use frankfurter.app for free else get a token from https://exchangerate.host/ |
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) 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.
The text was updated successfully, but these errors were encountered: