コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
2944 ビュー

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
567
1
2月 25
1275
0
9月 23
2233
2
6月 23
4056
1
8月 22
12796