Giter Site home page Giter Site logo

Comments (14)

falinwa avatar falinwa commented on July 24, 2024

Both for version 7 and version 8 doesn't work anymore.
Our country is in China.
Is this issue just happen to us?

I check that only Yahoo that not worked.

from account-financial-tools.

dstags-LO avatar dstags-LO commented on July 24, 2024

We are experiencing the same issue. Any news on this?

from account-financial-tools.

falinwa avatar falinwa commented on July 24, 2024

yes, we still waiting too, right now we just change the web services that we used.
Yahoo is not worked anymore.

from account-financial-tools.

dstags-LO avatar dstags-LO commented on July 24, 2024

Since we are unable to wait for a resolution, we dug into the code and fixed this issue.

It appears that the original URL utilized by the Yahoo API is no longer valid as manually calling it returns a 404 error. Reading into the API, I've reformatted the URL to properly return the csv file used for parsing the rate. Below is a snippet of the code I changed in currency_rate_update.py to get this working properly.

def get_updated_currency(self, currency_array, main_currency, max_delta_days):
    """implementation of abstract method of Curreny_getter_interface"""
    self.validate_cur(main_currency)
    #url='http://download.finance.yahoo.com/d/quotes.txt?s="%s"=X&f=sl1c1abg'
    url='http://download.finance.yahoo.com/d/quotes.csv?s=%s=X&f=sl1c1abg'

from account-financial-tools.

Jeelkhanpara avatar Jeelkhanpara commented on July 24, 2024

I check manually this url='http://download.finance.yahoo.com/d/quotes.csv?s=%s=X&f=sl1c1abg'
it shows in .csv file
=X N/A N/A N/A N/A N/A
it means Not Available.

from account-financial-tools.

dstags-LO avatar dstags-LO commented on July 24, 2024

%s is the variable passed into the URL intended to represent the currency you are trying to get a quote for. The reason it is returning N/A is because it doesn't know what currency you are trying to get rates for.

See This note:

Using YQL with the Yahoo Finance table (yahoo.finance.quotes) linked by NT3RP, currencies appear with symbol="ISOCODE=X", for example: "ARS=X" for Argentine Peso, "AUD=X" for Australian Dollar. "USD=X" doesn't exist, but it would be 1, since the rest are rates against USD

So a properly formed URL would return rates in the csv assuming you pass in a currency. Try this:

http://download.finance.yahoo.com/d/quotes.csv?s=EUR=X&f=sl1c1abg (Note: I replaced the %s with EUR to return the current FX for EUR against USD which always equals 1.

Hope it helps. Our chages to the code have been working perfectly for nearly a month.

from account-financial-tools.

Jeelkhanpara avatar Jeelkhanpara commented on July 24, 2024

hi,I Set url as you suggest , but log shows
!!! 2015-06-03 18:16:27.890209 not all arguments converted during string formatting !!!
My main currency is INR and Not Update any Currency Rate.

Have you change code in other area.

from account-financial-tools.

Jeelkhanpara avatar Jeelkhanpara commented on July 24, 2024

Have you any idea for me.what to do for currency rate update?.
Please Help me...

from account-financial-tools.

dstags-LO avatar dstags-LO commented on July 24, 2024

Since INR is the currency you are trying to get rates for, manually try this URL by copying and pasting into your browser window. It should return a csv file containing the FX for INR using USD as the base currency where USD = 1.

http://download.finance.yahoo.com/d/quotes.csv?s=INR=X&f=sl1c1abg

Steps:

  1. Find your currency_rate_update module located in your addons directory under openerp. (In my case it is located in /opt/openerp/addons/currency_rate_update).
  2. Within the module, open currency_rate_update.py and locate the Yahoo_getter class.
  3. Find the get_updated_currency function and edit the URL. (I've placed the code below)
  4. save, close, and reload the module

When you complete this, if it still doesn't work, please send along a log trace for further review.

Here is the entire class as it exists in my implementation:

#Yahoo ###################################################################################
class Yahoo_getter(Curreny_getter_interface) :
"""Implementation of Currency_getter_factory interface
for Yahoo finance service"""

def get_updated_currency(self, currency_array, main_currency, max_delta_days):
    """implementation of abstract method of Curreny_getter_interface"""
    self.validate_cur(main_currency)
    #url='http://download.finance.yahoo.com/d/quotes.txt?s="%s"=X&f=sl1c1abg'
    url='http://download.finance.yahoo.com/d/quotes.csv?s=%s=X&f=sl1c1abg'
    if main_currency in currency_array :
        currency_array.remove(main_currency)
    for curr in currency_array :
        self.validate_cur(curr)
        res = self.get_url(url%(main_currency+curr))
        val = res.split(',')[1]
        if val :
            self.updated_currency[curr] = val
        else :
            raise Exception('Could not update the %s'%(curr))

    return self.updated_currency, self.log_info  # empty string added by polish changes

from account-financial-tools.

Jeelkhanpara avatar Jeelkhanpara commented on July 24, 2024

Here is the class as it exists in my implementation openerp v5:
#Yahoo ###################################################################################
class Yahoo_getter(Curreny_getter_interface) :
"""Implementation of Currency_getter_factory interface
for Yahoo finance service"""

def get_updated_currency(self, currency_array, main_currency):
    """implementation of abstract method of Curreny_getter_interface"""
    self.validate_cur(main_currency)

    url='http://download.finance.yahoo.com/d/quotes.csv?s="INR"&f=sl1c1ab'
    if main_currency in currency_array :
        currency_array.remove(main_currency)
    for curr in currency_array :
        self.validate_cur(curr)
        res = self.get_url(url%(main_currency+curr))
        val = res.split(',')[1]
        if val :
            self.updated_currency[curr] = val
        else :
            raise Exception('Could not update the %s'%(curr))

    return self.updated_currency, self.log_info  # empty string added by polish changes

and Log is

currency updated at 2015-02-23 14:41:45.762483
currency updated at 2015-02-24 14:12:09.816829
currency updated at 2015-02-25 14:33:09.548328
currency updated at 2015-02-26 14:00:01.881651
currency updated at 2015-02-27 14:00:18.836724
currency updated at 2015-02-28 13:57:08.293352
currency updated at 2015-03-01 13:57:10.236598
currency updated at 2015-03-02 13:57:12.629513
currency updated at 2015-03-03 13:56:49.216760
currency updated at 2015-03-04 13:56:53.489923
!!! 2015-03-05 14:05:30.771612 invalid literal for float(): N/A !!!
!!! 2015-03-06 14:39:53.518634 invalid literal for float(): N/A !!!
!!! 2015-03-07 13:59:09.583830 invalid literal for float(): N/A !!!
!!! 2015-03-31 13:59:34.978732 invalid literal for float(): N/A !!!
!!! 2015-04-09 14:11:45.734716 invalid literal for float(): N/A !!!
!!! 2015-04-10 14:19:30.560043 'Yahoo_getter' object has no attribute 'MOD_NAME' !!!
!!! 2015-04-11 14:03:06.669076 invalid literal for float(): N/A !!!
!!! 2015-04-12 14:18:29.537300 invalid literal for float(): N/A !!!
!!! 2015-04-13 14:00:18.545623 invalid literal for float(): N/A !!!
!!! 2015-04-15 14:59:50.817912 invalid literal for float(): N/A !!!
!!! 2015-04-16 13:59:55.011081 invalid literal for float(): N/A !!!
!!! 2015-04-17 14:00:41.699551 invalid literal for float(): N/A !!!
!!! 2015-04-18 14:19:04.202124 'Yahoo_getter' object has no attribute 'MOD_NAME' !!!
!!! 2015-04-19 14:01:02.140207 invalid literal for float(): N/A !!!
!!! 2015-04-20 14:00:49.288238 invalid literal for float(): N/A !!!
!!! 2015-04-27 13:56:35.228880 invalid literal for float(): N/A !!!
!!! 2015-04-28 13:59:38.645442 invalid literal for float(): N/A !!!
!!! 2015-04-29 14:21:21.182386 invalid literal for float(): helvetica !!!
!!! 2015-04-30 13:59:44.457909 invalid literal for float(): helvetica !!!
!!! 2015-05-01 14:37:14.150637 invalid literal for float(): helvetica !!!
!!! 2015-06-03 17:48:33.648049 not all arguments converted during string formatting !!!
!!! 2015-06-03 17:50:42.925380 not all arguments converted during string formatting !!!
!!! 2015-06-03 17:57:01.522261 could not convert string to float: N/A !!!
!!! 2015-06-03 17:58:03.300027 not all arguments converted during string formatting !!!
!!! 2015-06-03 18:03:36.877545 cannot import name xpath !!!
!!! 2015-06-03 18:03:53.787360 cannot import name xpath !!!
!!! 2015-06-03 18:03:54.935934 cannot import name xpath !!!
!!! 2015-06-03 18:04:08.931734 not all arguments converted during string formatting !!!
!!! 2015-06-03 18:07:05.658250 not all arguments converted during string formatting !!!
!!! 2015-06-03 18:13:13.776442 unsupported format character 'I' (0x49) at index 52 !!!
!!! 2015-06-03 18:14:10.710144 not all arguments converted during string formatting !!!
!!! 2015-06-03 18:14:31.730713 cannot import name xpath !!!
!!! 2015-06-03 18:16:16.884433 cannot import name xpath !!!
!!! 2015-06-04 15:05:08.922863 not all arguments converted during string formatting !!!
!!! 2015-06-04 15:06:43.378952 cannot import name xpath !!!
!!! 2015-06-04 15:08:56.892056 not all arguments converted during string formatting !!!
!!! 2015-06-04 15:26:25.902607 not all arguments converted during string formatting !!! Test
INR
[2015-06-04 18:56:19,293][dc_2015_05_03] INFO:cron-rates:not all arguments converted during string formatting

i deleted some the line because more long file.
when I see in currency are it's not any update.it show last date update 03/04/2015.

from account-financial-tools.

dstags-LO avatar dstags-LO commented on July 24, 2024

Change your function call in the yahoo getter class (See my previous post above) to the code I've pasted below. Your error is because it is trying to identify where to insert the variable into the URL call and can not find the insert point which is represented by a %s. The URL you have formatted is also missing =X so it is improperly formatting your URL for calling Yahoo. Also, you are running v5 and I am running v7 so while it is unlikely, there is a possibility it will not work as I've not tested in anything other than v7.

def get_updated_currency(self, currency_array, main_currency):
"""implementation of abstract method of Curreny_getter_interface"""
self.validate_cur(main_currency)

url='http://download.finance.yahoo.com/d/quotes.csv?s=%s=X&f=sl1c1abg'
if main_currency in currency_array :
    currency_array.remove(main_currency)
for curr in currency_array :
    self.validate_cur(curr)
    res = self.get_url(url%(main_currency+curr))
    val = res.split(',')[1]
    if val :
        self.updated_currency[curr] = val
    else :
        raise Exception('Could not update the %s'%(curr))

return self.updated_currency, self.log_info  # empty string added by polish changes

from account-financial-tools.

falinwa avatar falinwa commented on July 24, 2024

I think this must be merge with the fix?

from account-financial-tools.

rossigee avatar rossigee commented on July 24, 2024

The hostname 'download.finance.yahoo.com' no longer resolves. The Yahoo getter should probably be removed/replaced.

from account-financial-tools.

github-actions avatar github-actions commented on July 24, 2024

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

from account-financial-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.