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