[FIX] http_routing: geoip longitude/latitude available
In 2018 geoip2 support was added to allow the new database format that are freely available. But for these, only a subset of properties are available. Since Odoo 13 (August 2019), the sign module is using geoip latitude and longitude for logging access to sign module signatures, but this was only working for database using the first version of GeoIP databases. In other use case there would never be any geolocalization recorded. With this change, latitude and longitude are available in the session if the right module/database is installed. opw-2426323 closes odoo/odoo#73997 X-original-commit: 2be13b57749ac2c45de60717544c3061bbb29671 Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit is contained in:
@@ -55,6 +55,8 @@ class GeoIPResolver(object):
|
||||
'city': r.city.name,
|
||||
'country_code': getattr(country, attr),
|
||||
'country_name': country.name,
|
||||
'latitude': r.location.latitude,
|
||||
'longitude': r.location.longitude,
|
||||
'region': r.subdivisions[0].iso_code if r.subdivisions else None,
|
||||
'time_zone': r.location.time_zone,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user