Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3127 มุมมอง

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)])
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello,

You will try this

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

Thank you,
อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง

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 ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 25
823
Search a message แก้ไขแล้ว
1
ก.พ. 25
1448
0
ก.ย. 23
2405
2
มิ.ย. 23
4359
1
ส.ค. 22
13024