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