odoo 获取IP地址
use this chunk of code
USER_PRIVATE_FIELDS = ['password']
@api.model
def _check_credentials(self, password):
result = super(LoginUserDetail, self)._check_credentials(password)
ip_address = request.httprequest.environ['REMOTE_ADDR'] # 待验证
vals = {'name': self.name,
'ip_address': ip_address
}
self.env['login.detail'].sudo().create(vals)
return result
本文来自博客园,作者:那时一个人,转载请注明原文链接:https://www.cnblogs.com/qianxunman/p/12264405.html