|
|
@ -26,7 +26,7 @@ from odoo.addons.portal.controllers.web import Home |
|
|
|
from odoo.http import request |
|
|
|
|
|
|
|
|
|
|
|
class GeoIP(Home): |
|
|
|
class Geolocation(Home): |
|
|
|
""" controller for selecting login user's datas """ |
|
|
|
def get_location(self, ip_address): |
|
|
|
""" get location details of user using ip address""" |
|
|
@ -36,7 +36,7 @@ class GeoIP(Home): |
|
|
|
@http.route() |
|
|
|
def web_login(self, redirect=None, **kw): |
|
|
|
""" on login access customer country information """ |
|
|
|
result = super(GeoIP, self).web_login(redirect=redirect, **kw) |
|
|
|
result = super(Geolocation, self).web_login(redirect=redirect, **kw) |
|
|
|
request.env.user.write({'ip_address': kw.get('user_ip')}) |
|
|
|
datas = self.get_location(kw.get('user_ip')) |
|
|
|
if datas: |
|
|
|