| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 70 |
| Technical Name |
smart_space_search |
| License | LGPL-3 |
| Website | https://alshayebco.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 70 |
| Technical Name |
smart_space_search |
| License | LGPL-3 |
| Website | https://alshayebco.com |
Smart Space Search
Stop typing % — let spaces do the work
Every space you type in a partner or product search automatically becomes a SQL wildcard. Type john smith and find John A. Smith, John Doe Smith, or any record where both fragments appear — naturally, without typing a single %.
Works on every Many2one and Many2many dropdown pointing to partners or products — in any module, any view, with zero configuration.
Before & After
Without Smart Space Search
Typing "john sm" — Odoo finds nothing
With Smart Space Search
Same search — multiple matching contacts found instantly
Complete Search Coverage
Every Many2one and Many2many dropdown pointing to partners or products is automatically enhanced — from any module, any view.
Partners & Contacts
Name · Email · Phone · Ref · VAT · Registry
All six fields searched simultaneously in a single OR-domain query. Find any contact from any identifying piece of information.
Products
Name · SKU / Ref · Barcode
Searches product templates and variants. Type a partial barcode or internal reference and it finds the right product instantly.
Zero Configuration
No Settings · No Menus · No Schema
Install and it works immediately, everywhere. No setup screens, no custom fields, no database migrations required.
Search by Any Field
Type a phone number, reference code, email, or VAT number directly in a partner dropdown and find the right contact immediately — no need to open a separate search window.
Partner search — by name fragment
Partner search — by reference or phone number
Works on Products Too
Search product name, internal reference (SKU), and barcode — all in one query, across both product templates and variants.
Arabic Support Built-In
Search works identically in Arabic and any Unicode language
- Full Unicode support — any language works
- Arabic names match the same way English names do
- Mixed-language records are searchable in either script
- RTL display is fully respected by Odoo's interface
Works with All Custom Modules
Smart Space Search overrides name_search() at the model level — not on specific fields or views. This means it works automatically with every Many2one and Many2many dropdown pointing to partners or products, no matter which module created them.
Custom CRM fields, third-party delivery modules, manufacturing add-ons, custom invoicing workflows — if they use a partner or product dropdown, Smart Space Search is already active. No extra configuration, no per-module setup.
Built the Right Way
Designed to be safe, minimal, and fully compatible with the Odoo ecosystem — including multi-company environments and all third-party modules.
- No custom tables or fields — pure behavioral override at the ORM level
- ORM-native — fully respects access rights, record rules, and multi-company restrictions
- Works with all custom modules — any Many2one or Many2many pointing to partners or products
- OR-domain logic — multiple fields searched simultaneously in one efficient query
- Language-agnostic — space normalization works with any Unicode script
- Safe to uninstall — no residual data, no schema changes, no cleanup needed
About AlShayeb Partners
AlShayeb Partners is a professional services firm based in Bethlehem, Palestine, specializing in accounting, auditing, consulting, and Odoo ERP implementation since 1973.
https://alshayebco.com
Smart Space Search
Overview
Smart Space Search overrides name_search() on res.partner, product.product, and product.template to automatically convert spaces into SQL wildcards (%). This enables wildcard sequence matching in relational autocomplete fields (Many2one, Many2many).
When a user types john smith in a customer dropdown, the module searches for john%smith, matching any record where both fragments appear in sequence. The behavior is language-agnostic and works identically for English, Arabic, and any Unicode text.
Architecture
The module uses a helper mixin + explicit model overrides pattern:
- smart.space.search.mixin (AbstractModel)
Provides two shared methods:
- _normalize_search_term(name): collapses multiple spaces, then replaces remaining spaces with %
- _smart_search_domain(term, operator): builds an OR domain across all fields listed in _smart_search_fields
Each target model inherits the mixin and defines its own name_search() override:
- If operator is not ilike/like or name is empty, delegate to super() unchanged
- Normalize the search term (space to %)
- Build an OR domain across all configured search fields
- Combine with the incoming domain (AND)
- Call super() with name='' and the combined domain
Search Fields
- res.partner:
- complete_name, ref, email, phone, vat, company_registry
- product.product:
- name, default_code, barcode
- product.template:
- name, default_code, barcode
Performance
The module uses the Odoo 19 Domain class for efficient domain construction. The limit parameter is always preserved, ensuring autocomplete queries remain bounded. For typical SME databases (< 50K partners, < 20K products), there is no perceptible performance impact.
Uninstallation
The module can be safely uninstalled at any time. It creates no custom database tables, no custom fields, and no stored data. Uninstalling immediately restores standard Odoo search behavior with no residual effects.
Please log in to comment on this module