diff --git a/customer_geolocation/controllers/main.py b/customer_geolocation/controllers/main.py index e7e2f4941..045679b46 100644 --- a/customer_geolocation/controllers/main.py +++ b/customer_geolocation/controllers/main.py @@ -36,7 +36,6 @@ class PortalGeolocation(CustomerPortal): def account(self, **post): """ Super CustomerPortal class function and pass the api key value from settings using params to website view file""" - res = super(PortalGeolocation, self).account(**post) params = request.env['ir.config_parameter'].sudo() values = params.get_param('base_geolocalize.google_map_api_key') @@ -58,9 +57,8 @@ class PortalGeolocation(CustomerPortal): the converted Latitude and longitude """ res = json.loads(coordinates) - geolocator = Nominatim(user_agent="geoapiExercises") - location = geolocator.reverse( - str(res.get('lat')) + "," + str(res.get('lng'))) + geolocator = Nominatim(user_agent="my-app") + location = geolocator.reverse(f'{res.get("lat")},{res.get("lng")}') city = "Undefined" suburb = "Undefined" state = "Undefined" @@ -98,11 +96,9 @@ class PortalGeolocation(CustomerPortal): Pass the value to website view and set required fields and map """ - locator = Nominatim(user_agent="myGeocoder") + locator = Nominatim(user_agent='my-app') location = locator.geocode(address) - geolocator = Nominatim(user_agent="geoapiExercises") - location_country = geolocator.reverse( - str(location.latitude) + "," + str(location.longitude)) + location_country = locator.reverse(f'{location.latitude},{location.longitude}') addresses = location_country.raw['address'] country_code = addresses.get('country_code') country = pytz.country_names[country_code] diff --git a/customer_geolocation/doc/RELEASE_NOTES.md b/customer_geolocation/doc/RELEASE_NOTES.md index e1c37c5a3..7a5ccadc2 100644 --- a/customer_geolocation/doc/RELEASE_NOTES.md +++ b/customer_geolocation/doc/RELEASE_NOTES.md @@ -1,7 +1,13 @@ -## Module +## Module #### 14.03.2023 #### Version 16.0.1.0.0 #### ADD - Initial commit for Customer Geolocation + +#### 09.05.2024 +#### Version 16.0.1.0.1 +#### BUG FIX + +- Bug Fix for Customer Geolocation diff --git a/customer_geolocation/static/src/css/cust_geolocation.css b/customer_geolocation/static/src/css/cust_geolocation.css index 1c5d5548d..28761e4b7 100644 --- a/customer_geolocation/static/src/css/cust_geolocation.css +++ b/customer_geolocation/static/src/css/cust_geolocation.css @@ -5,4 +5,4 @@ float: right; width: 70%; height: 450px; - } \ No newline at end of file + } diff --git a/customer_geolocation/views/portal_templates.xml b/customer_geolocation/views/portal_templates.xml index ecf518be4..2375c4d40 100644 --- a/customer_geolocation/views/portal_templates.xml +++ b/customer_geolocation/views/portal_templates.xml @@ -134,7 +134,6 @@ $('#p_code').val(p_code); $('#country_show').val(country); $('#geo_state').val("2"); - } }) });