Commit Graph
8 Commits
Author SHA1 Message Date
Saurabh Choraria 2a9d0ce128 [FIX] base_geolocalize: update log when request to openstreetmap fails
When the user will not get an HTTP response as 200 while retrieving the location
using OpenStreetMap Nominatim service, the logger error will occur.

The logger is updated to use the 'warning' level instead of the 'error' level.
This change reflects a less severe logging level for cases where a request to
OpenStreetMap fails.

sentry-4151622143

closes odoo/odoo#125835

X-original-commit: a73a65efc0daa702b6a3fd40ad63d2ef39ace302
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-06-21 15:53:15 +02:00
niyasraphy d9281dcaec [IMP] base_geolocalize : form view for base.geo_provider model
closes odoo/odoo#106374

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-16 19:45:52 +01:00
qho 4496ce31aa [FIX] base_geolocalize: access blocked by OpenStreetMap
The geolocation service from OpenStreetMap will not be unblocked until a
'meaningful' and identical user-agent added in the request.

opw-2221857

closes odoo/odoo#48805

X-original-commit: 9018039b835547ea4adbc32a23901214613a033a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-01 21:22:04 +00:00
Jeremy Kersten 50d21df156 [FIX] base_geolocalize: allow to force country in request
Before this commit, using google geoloc, we only provide a string as address
withtout more information.

Now by defaut, we force the country as components:
https://developers.google.com/maps/documentation/geocoding/intro#geocoding

Related to task-2030886

**setup:**
```python
url = "https://maps.googleapis.com/maps/api/geocode/json"
```

**before:**
```python
params = {'address': 'Georgia', 'key': apikey}
requests.get(url, params).json()
```

>       ==> Return coordinate of "Georgia, United States"
>           What is completely wrong
>

**after:**
```python
params = {'address': 'Georgia', 'components':'country:Georgia', 'key': apikey}
requests.get(url, params).json()
```

>       ==> Return Nothing
>          What is strange but less wrong than US
>

```python
params = {'address': 'Belgium', 'components':'country:Belgium', 'key': apikey}
requests.get(url, params).json()
```

>       ==> Return coordinate of Belgium

closes odoo/odoo#34582

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-07-04 13:08:42 +00:00
Jeremy Kersten a5b1a288a6 [FIX] base_geolocalize: handle ZERO_RESULTS as google response
Before this commit, it was considered as an error because status was not OK

closes odoo/odoo#34377

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-26 10:00:59 +00:00
Christophe Simonis d32420397d [MERGE] forward port branch 12.0 up to 251021796c 2019-04-04 11:20:03 +02:00
Jeremy Kersten 6c67539b92 [REF] base_geolocalize, base_setup: ref + make it configurable in settings
Migrate in v12 and Refactor a part of the code
Allow to configure it in setting
2018-11-16 16:24:49 +00:00
Emanuel Cino 0fda77e777 [FIX] base_geolocalize allow to use Openstreetmap instead of Google
- Change API provider to prevent invalid API calls
- Move geo_find methods into base.geocoder object to ease inheritance
- Add system parameter to allow use of another provider

fixes #x26924
fixes #x6929
2018-11-15 18:13:46 +00:00