Skip to content
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

Add Google currency data provider. #481

Closed
wants to merge 5 commits into from

Conversation

rossigee
Copy link

As per subject, this patch adds a new provider based on the Google Currency Converter.

This was done for use with 9.0, and I'm just putting out there for anyone that might find it useful. I will submit a separate PR once I've updated and tested it to work against 10.0.

@adrienpeiffer
Copy link
Contributor

@rossigee Can you fix pylint issues ?

@rossigee
Copy link
Author

@adrienpeiffer - I've fixed the missing line it reports in the Python file. The RST file error doesn't appear to be related to my patch, but if it is, I don't know why or how to fix.

# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@adrienpeiffer
Copy link
Contributor

@rossigee I just tested your module on runbot. But why I try to update currency that takes a lot of time with no result. I tested only with one currency (GBP). Did I miss something ?

@rossigee
Copy link
Author

rossigee commented Jun 2, 2017

@adrienpeiffer - Sorry, I'm not familiar with runbot. I have only tested this on real systems. How can I reproduce?

@adrienpeiffer
Copy link
Contributor

The related runbot build is killed. I just started a new one. You have to wait the end of the build to test it

@rossigee
Copy link
Author

rossigee commented Jun 2, 2017

@adrienpeiffer - I still do not understand. How can I reproduce the problem you are describing?

@adrienpeiffer
Copy link
Contributor

@rossigee
Copy link
Author

rossigee commented Jun 2, 2017

@adrienpeiffer - what is the login?

@adrienpeiffer
Copy link
Contributor

admin - admin 😄

@rossigee
Copy link
Author

rossigee commented Jun 2, 2017

@adrienpeiffer - thanks, that worked.

Unfortunately, I'm having trouble configuring the instance in order to test with it. This is what I did after logging in.

  1. Enabled developer mode in the 'About' panel.
  2. Enabled 'multi currency' in the Accounts -> Configuration -> Settings.
  3. Checked there were active currencies in Accounts -> Multi-Currencies -> Currencies. Present are 'USD' and 'EUR', which should be fine.
  4. Create a new currency rate update in Accounts -> Currency Rate Update.

At this point, regardless of whether I choose an existing webservice (i.e. Yahoo) or the new one, it does not offer me any currencies to add when I click 'Add an item' in the 'Currencies to update with this service' table.

What have I missed?

@adrienpeiffer
Copy link
Contributor

All currencies was inactive. I just created a record of currency.rate.update.service in runbot

@rossigee
Copy link
Author

rossigee commented Jun 2, 2017

OK, it seems you must choose the service, click 'Save' and then add currencies. I was trying to add currencies while creating the service, which it seems unable to do. That's a separate bug/issue, as is trying to add a currency without a service being selected, which produces a JS stacktrace.

Anyway. I can now see/reproduce the issue on runbot. However, I have no idea where to find runbot's instance logs to look for errors/warnings, or how to further debug the instance.

As a control measure, I have also added the Yahoo service and configured it similarly. This also exhibits the same behaviour, which suggests that either:

a) This is some kind of bug present in more than just the new service.
b) There is something about the runbot instance/configuration that is preventing this from working as expected.

Are we sure that the runbot instance is able to make outbound HTTPS calls successfully?

Copy link

@elicoidal elicoidal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!
Can you improve the README file:

Can you bump version number in manifest?

if match:
val = match.group()[16:-11]
if curr in self.invert_currencies:
val = str(1.0 / float(val))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not you test for val <>0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why that would be necessary. The other service implementations don't check for zero. IMHO, if it were necessary, that should be the subject of a separate patch that addresses the potential issue in all the services.

@rossigee
Copy link
Author

rossigee commented Jun 4, 2017

@elicoidal - This patch does not change any documented behaviour. Such improvements/additions to the README should be the subject of a separate patch.

@elicoidal
Copy link

@rossigee OK: understand your point about additional PR.

Still a bump in version is necessary

@rossigee
Copy link
Author

rossigee commented Jun 4, 2017

@elicoidal - the one in openerp.py? which of the five digits to bump?! I would guess '9.0.1.0.1'? (sorry, I'm new here!)

@elicoidal
Copy link

@rossigee
Copy link
Author

rossigee commented Jun 4, 2017

@elicoidal - thanks for that. It says the 'y' figure should be incremented for non-breaking new features (i.e. 9.0.1.1.0). I've updated the patch accordingly.

@gurneyalex gurneyalex added this to the 9.0 milestone Oct 16, 2017
@github-actions
Copy link

github-actions bot commented May 8, 2022

There hasn't been any activity on this pull request in the past 4 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 PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 8, 2022
@github-actions github-actions bot closed this Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review question stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants