Skip to Content
मेन्यू
This question has been flagged
2 Replies
2861 Views

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)])
Avatar
Discard
Best Answer

Hello,

You will try this

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

Thank you,
Avatar
Discard
Author Best Answer

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

Avatar
Discard

hello

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

Related Posts Replies Views Activity
1
जुल॰ 25
391
1
फ़र॰ 25
1213
0
सित॰ 23
2154
2
जून 23
3913
1
अग॰ 22
12684