تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3166 أدوات العرض

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يوليو 25
960
Search a message تم الحل
1
فبراير 25
1531
0
سبتمبر 23
2476
2
يونيو 23
4479
1
أغسطس 22
13140