[REV] base_geolocalize: revert useragent selection

The commit  https://github.com/odoo/odoo/commit/160e8bfbf72a3e5d7cc8d8cbe7bc4f310f298baa introduced a way to update the
useragent used to request openstreetmap nominatim service.

It was introduced as a bad fix to prevent an erroneous blacklist from the
service. Once the blacklist has been removed, this fix was not necessary
anymore. It also allows to abuse the free service which is against the
osmfoundation policy. The best solution would be to decrease the amount of
request. The Google Place Map service is also available to avoid using the
openstreetmap service with large database.

closes odoo/odoo#138078

X-original-commit: 2726d2724e06e5818eaf2d0010971554372c4727
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
This commit is contained in:
Arnaud Joset
2023-10-10 07:15:45 +00:00
parent cc46c13cd3
commit 24d63c1474
@@ -87,8 +87,7 @@ class GeoCoder(models.AbstractModel):
return None
url = 'https://nominatim.openstreetmap.org/search'
try:
headers = {'User-Agent': self.env['ir.config_parameter'].sudo().get_param('base_geolocalize.user_agent',
'Odoo (http://www.odoo.com/contactus)')}
headers = {'User-Agent': 'Odoo (http://www.odoo.com/contactus)'}
response = requests.get(url, headers=headers, params={'format': 'json', 'q': addr})
_logger.info('openstreetmap nominatim service called')
if response.status_code != 200: