Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 48 |
Technical Name |
pattern_search |
License | LGPL-3 |
Pattern Search
Autocomplete search in the form view

Autocomplete search in the search view

Pattern search in the search view

ð¢ Available for Hire!
Looking for a skilled and reliable Odoo Developer to bring your business ideas to life? or to fix things? or to analyze unwanted results? or to do whatever in odoo
Letâs build something great together! I specialize in custom module development, ERP implementation, and performance tuning tailored to your needs.
ð¬ Hire Me wa.me/923482852693 /rajeelzahid
Overview
This module enhances the search behavior of many2x
fields in Odoo by introducing a pattern-based
search mechanism. Instead of relying solely on the default ilike
search, it allows users to search
by meaningful fragments of the name. This is particularly helpful in cases where records (e.g. employees) share
common prefixes like "Muhammad", enabling quicker and more intuitive access to relevant records.
Key Features
- Improves usability of
many2x
fields with large datasets - Supports pattern-based searching (e.g., "muhra" matches "Muhammad Rajeel")
- Context-aware as only applies when explicitly enabled
- Lightweight and non-intrusive to existing logic
- Compatible with all standard and custom models
How to Use
-
Autocomplete search in the form view
In your form view XML, add
context="{'pattern_search': True}"
to themany2x
field definition.Example:
<form> <field name="employee_id" context="{'pattern_search': True}" /> </form>
Once enabled, the field will support pattern matching: typing
muhra
will match "Muhammad Rajeel", andrjl
will also return similar results even if the full name doesn't begin with it. -
Autocomplete search in the search view
In your search view XML, add
context="{'pattern_search': True}"
to the field definition.Example:
<search> <field name="department_id" context="{'pattern_search': True}" /> </search>
Once enabled, the field will support pattern matching: typing
proser
will match "Professional Services", -
Pattern search in the search view
Same as #2
Example:
<search> <field name="name" context="{'pattern_search': True}" /> </search>
Once enabled, the field will support pattern matching: searching
muhra
will match "Muhammad Rajeel",Use with
filter_domain
:If using
filter_domain
in search field, useraw_value
instead ofself
in domainExample:
<search> <field name="name" string="Employee" filter_domain="['|', ('work_email', 'ilike', self), ('name', 'ilike', raw_value)]" context="{'pattern_search': True}"/> </search>
work_email
will be searched without pattern butname
will be searched with pattern
Please log in to comment on this module