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

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!

 

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
نوفمبر 22
3312
0
نوفمبر 16
2532
1
أبريل 15
3265
1
مارس 15
4648
0
مارس 15
4530