In wizard I have 2 fields one is res.users' m2o and Password. here user will ask the manager to enter the password to approve the process by entering the manager's password. But I am not able to find the way how to check that in the wizard and get true if password match and false if not matched.
Pertanyaan ini telah diberikan tanda
1
Balas
7974
Tampilan
there is already login method written name as in res_user.py. You can take reference and apply same from your wizard.
@classmethod
def _login(cls, db, login, password):
if not password:
return False
user_id = False
try:
with cls.pool.cursor() as cr:
self = api.Environment(cr, SUPERUSER_ID, {})[cls._name]
user = self.search([('login', '=', login)])
if user:
user_id = user.id
user.sudo(user_id).check_credentials(password)
user.sudo(user_id)._update_last_login()
except AccessDenied:
user_id = False
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|
|
0
Mei 25
|
3560 | ||
|
How to recover master password if I forgot it?
Diselesaikan
|
|
13
Sep 24
|
199477 | |
|
|
2
Agu 24
|
3368 | ||
|
Database specific Master password - does it exist?
Diselesaikan
|
|
2
Jul 24
|
15339 | |
|
Just started and I can't log in!
Diselesaikan
|
|
6
Des 23
|
45595 |