Before this commit, the useragent was harcoded as an Odoo one and if it was
blacklisted by the osmfoundation policy https://operations.osmfoundation.org/policies/nominatim/
all Odoo instances were forbidden to access the service.
This parameter allows to override the user agent with a system parameter.
closesodoo/odoo#134376
X-original-commit: 160e8bfbf72a3e5d7cc8d8cbe7bc4f310f298baa
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
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
closesodoo/odoo#125835
X-original-commit: a73a65efc0daa702b6a3fd40ad63d2ef39ace302
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
The geolocation service from OpenStreetMap will not be unblocked until a
'meaningful' and identical user-agent added in the request.
opw-2221857
closesodoo/odoo#48805
X-original-commit: 9018039b835547ea4adbc32a23901214613a033a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#34582
Signed-off-by: Christophe Simonis <chs@odoo.com>
Before this commit, it was considered as an error because status was not OK
closesodoo/odoo#34377
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
- 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