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

When I have created a search and I search, for example, by user, I can type just one letter and find all that contains that letter.

How come I can't search numbers in the same way?

eg. when I need user named "user", I can type in the search bar "us" and get the list

when I need ticket number 12345678, I can't type "123" and get a list, I have to type the full number out.

Is this a rule or is there a way around this?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

@Siobhan,

You could change the filter_domain used in the SEARCH view.

<field name="ticket_number" string="Ticket number" filter_domain="[('ticket_number','ilike',self)]"/>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can enable developer mode by clicking on the top right corner and then "About Odoo" and then "Activate Developer Mode". After that, as an example, you can click on Accounting -> Customers and view the Search View in the Debug menu.

In there you will find rules that define how searching is done on a certain object.



อวตาร
ละทิ้ง
ผู้เขียน

Thank you for this but I can't find any example on a search by a number. Checked the helpdesk module and it doesn't have this search function either

ผู้เขียน คำตอบที่ดีที่สุด

For this particular case as ticket number was not been used for arithmetic, I change it to a char and was able to do a search. 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
I can't find the error using search() แก้ไขแล้ว
1
ก.ย. 15
5443
1
มี.ค. 15
8757
3
มิ.ย. 16
4520
1
ก.ค. 25
554
Search a message แก้ไขแล้ว
1
ก.พ. 25
1253