'retrieve the user corresponding to login (login or email),
and reset their password'

def reset_password(self, login):

    users = self.search([('login', '=', login)])
    if (not users):
        users = self.search([('email', '=', login)])
    if (len(users) != 1):
        raise Exception(_('Reset    password:    invalid    username    or    email'))
    return users.action_reset_password()
