跳至内容
菜单
此问题已终结
2 回复
2897 查看

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
481
1
2月 25
1242
0
9月 23
2185
2
6月 23
3996
1
8月 22
12748