Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2871 Widoki

I want to find user by user's email. And here is my code but i get no result from it.

user = request.env["res.users"].search([('login', 'ilike', email)])
Awatar
Odrzuć
Najlepsza odpowiedź

Hello,

You will try this

user = request.env["res.users"].search([('login', '=', email)])

Thank you,
Awatar
Odrzuć
Autor Najlepsza odpowiedź

thanks for your reply, i have already tried your solution but it's not giving me any user.

Awatar
Odrzuć

hello

just use email.encode('utf-8') instead of email here [('login','=',email)] , as the email have some special character in your case.

Powiązane posty Odpowiedzi Widoki Czynność
1
lip 25
431
Search a message Rozwiązane
1
lut 25
1221
0
wrz 23
2165
2
cze 23
3940
1
sie 22
12715