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

Hi, 


Would it be possible on filters to add an operator beginning with

Example use case: Filter on companies in the same department. To do this, I need to filter on postal codes starting with “02”.


Merci pour votre aide

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

Hello,

Thank you for your reply, but I don't quite understand where I can enter the query you're giving me, or what "ilike operator" means..

Can you enlighten me further?

Thanks & Regards, 

อวตาร
ละทิ้ง

The "=ilike" operator in Odoo is used for case-insensitive search, and the "%" wildcard allows for flexible pattern matching.

for example:
<field name="name" filter_domain="[('complete_name', '=ilike', 'can%')]"/>

This filter will indeed retrieve all records where the complete_name field starts with "can" (case-insensitive). The "can%" pattern matches any string that begins with "can", which is perfect for finding all customer names that start with this prefix.

คำตอบที่ดีที่สุด

Hello Bourillon Thibault,

In search view, We can use =ilike operator along with % wildcard around the searched expression. 
For example. following search filter will search all the name of the customer which starts with "can" 

<field name="name" filter_domain="[('complete_name', '=ilike', 'can%')]"/>

Thanks & Regards,

CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209

Email: info@candidroot.com

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
พ.ย. 24
1201
"THIS YEAR" FILTER STUDIO แก้ไขแล้ว
1
เม.ย. 22
3428
1
เม.ย. 22
1921
1
ส.ค. 21
11319
1
เม.ย. 20
3797