[MERGE] forward port branch saas-14 up to d158a8ffbf

This commit is contained in:
Christophe Simonis
2019-04-02 12:34:15 +02:00
@@ -31,7 +31,13 @@ def geo_find(addr, apikey=False):
if result['status'] != 'OK':
if result.get('error_message'):
_logger.error(result['error_message'])
return None
error_msg = _('Unable to geolocate, received the error:\n%s'
'\n\nGoogle made this a paid feature.\n'
'You should first enable billing on your Google account.\n'
'Then, go to Developer Console, and enable the APIs:\n'
'Geocoding, Maps Static, Maps Javascript.\n'
% result['error_message'])
raise UserError(error_msg)
try:
geo = result['results'][0]['geometry']['location']