콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4527 화면

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
11월 22
3423
0
11월 16
2534
1
4월 15
3288
1
3월 15
4658
0
3월 15
4559