fixed?
This commit is contained in:
parent
fe6257f576
commit
0c74bfafb9
1 changed files with 5 additions and 9 deletions
|
|
@ -10,13 +10,11 @@ class WebsiteVisitor(models.Model):
|
||||||
_inherit = 'website.visitor'
|
_inherit = 'website.visitor'
|
||||||
|
|
||||||
# Ajout de champs supplémentaires pour collecter plus d'informations sur le visiteur
|
# Ajout de champs supplémentaires pour collecter plus d'informations sur le visiteur
|
||||||
region = fields.Char("Region")
|
city = fields.Char("City")
|
||||||
postal_code = fields.Char("Postal Code")
|
postal_code = fields.Char("Postal Code")
|
||||||
latitude = fields.Float("Latitude")
|
latitude = fields.Float("Latitude")
|
||||||
longitude = fields.Float("Longitude")
|
longitude = fields.Float("Longitude")
|
||||||
ip_address = fields.Char("IP Address")
|
ip_address = fields.Char("IP Address")
|
||||||
isp = fields.Char("Internet Service Provider")
|
|
||||||
connection_type = fields.Char("Connection Type")
|
|
||||||
device_type = fields.Char("Device Type")
|
device_type = fields.Char("Device Type")
|
||||||
operating_system = fields.Char("Operating System")
|
operating_system = fields.Char("Operating System")
|
||||||
browser = fields.Char("Browser")
|
browser = fields.Char("Browser")
|
||||||
|
|
@ -44,13 +42,11 @@ class WebsiteVisitor(models.Model):
|
||||||
|
|
||||||
# Mise à jour du visiteur avec les nouvelles données
|
# Mise à jour du visiteur avec les nouvelles données
|
||||||
update_values = {
|
update_values = {
|
||||||
'region': geoip_info.get('region'),
|
'city': geoip_info.city.names.en,
|
||||||
'postal_code': geoip_info.get('postal_code'),
|
'postal_code': geoip_info.postal.code,
|
||||||
'latitude': geoip_info.get('latitude'),
|
'latitude': geoip_info.location.latitude,
|
||||||
'longitude': geoip_info.get('longitude'),
|
'longitude': geoip_info.location.longitude,
|
||||||
'ip_address': request.httprequest.remote_addr,
|
'ip_address': request.httprequest.remote_addr,
|
||||||
'isp': geoip_info.get('isp'),
|
|
||||||
'connection_type': geoip_info.get('connection_type'),
|
|
||||||
'device_type': user_agent.platform,
|
'device_type': user_agent.platform,
|
||||||
'operating_system': user_agent.platform, # Modifié pour utiliser platform
|
'operating_system': user_agent.platform, # Modifié pour utiliser platform
|
||||||
'browser': user_agent.browser,
|
'browser': user_agent.browser,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue