-
- Downloads
[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>
Showing
- addons/base_geolocalize/models/base_geocoder.py 8 additions, 6 deletionsaddons/base_geolocalize/models/base_geocoder.py
- addons/base_geolocalize/models/res_partner.py 2 additions, 2 deletionsaddons/base_geolocalize/models/res_partner.py
- addons/website_crm_partner_assign/tests/test_partner_assign.py 1 addition, 1 deletion...s/website_crm_partner_assign/tests/test_partner_assign.py
Please register or sign in to comment