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

I am trying to get all partners that have a certain email address. The issue is, however, that the email addresses in our database are not sanitised, and thus that they can contain capital letters. I can not change this in the database.
As capitalisation does not matter for the email protocol, I would like to search on email address case insensitive.


Code:

models.execute_kw(db, uid, password,
            'res.partner', 'search_read',
            [[['email', operator, email]]],
            {'fields': [], 'limit': 20}

Thank you for your response!

PS: Bonus points to additionally remove sensitivity to points (".") for e.g. Gmail addresses.

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

I wanted to close this ticket as I figured it out (just use the operator =ilike), but I don't have the karma to close my own ticket... Attempting to edit my question results in an error.

I am still looking for a solution for the following problem:


I am trying to get all partners that have a certain email address. The issue is, however, that the email addresses in our database are not sanitised, and thus that they can contain ".", even though this does not matter for google emails. I can not change this in the database.
I would like to search on email address "." insensitive.

e.g. 123.user@gmail.com should be findable via 123user@gmail.com

Code:
models.execute_kw(db, uid, password,
            'res.partner', 'search_read',
            [[['email', '=ilike', email]]],
            {'fields': [], 'limit': 20}
Thank you for your response!

 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 22
3308
0
พ.ย. 16
2532
[SOLVED] Search a client by email adress แก้ไขแล้ว
1
เม.ย. 15
3264
1
มี.ค. 15
4648
0
มี.ค. 15
4530