跳至內容
選單
此問題已被標幟
2 回覆
2931 瀏覽次數

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
7月 25
554
1
2月 25
1253
0
9月 23
2222
2
6月 23
4042
1
8月 22
12779