Advanced search interface for the registry using CEL (Common Expression Language) expressions. Provides a dedicated portal where users can write CEL queries to filter registrants based on demographics, eligibility criteria, or custom data fields.
- CEL Expression Editor: Write and validate CEL expressions with syntax highlighting, autocomplete, and real-time validation
- Profile Selection: Search across Individuals or Groups with profile-specific field validation
- Live Validation: See match counts before executing the search, with inline error messages for invalid syntax
- Clickable Results: View search results in a list, click any registrant to open their form view
- Result Limiting: Displays up to 50 results with a count indicator when more matches exist
This module does not define any Python models. It provides a client-side
JavaScript component (CelSearchPortal) that calls
spp.cel.service from spp_cel_domain to compile and execute CEL
expressions.
No configuration required. After installation, the Advanced Search menu appears automatically under Registry.
- Menu: Registry > Advanced Search
- URL Path:
/odoo/registry-cel - Results: Click any search result to open the registrant form view
| Group | Access |
|---|---|
spp_cel_registry_search.group_cel_search_user |
Access to Advanced Search portal |
spp_registry.group_registry_officer |
Automatically includes CEL Search access |
The group_cel_search_user group implies
spp_registry.group_registry_viewer, ensuring users can only search
registrants they have permission to view.
- Inherit ``CelSearchPortal`` component: Override
performSearch()to customize query logic or add filters - Extend result display: Modify the QWeb template
spp_cel_registry_search.CelSearchPortalto show additional registrant fields - Add custom actions: Override
openRegistrant()to trigger custom workflows when clicking search results
spp_registry, spp_cel_domain, spp_cel_widget
Table of contents
- OpenSPP instance with
spp_cel_registry_searchmodule installed - Demo data loaded (registrants with various attributes: birthdate, gender, registration date, phone, email, disabled status)
- At least one user with Registry Officer role (has CEL Search access automatically)
- At least one base user without Registry Officer or CEL Search User group
The CEL Registry Search module adds an Advanced Search portal under
the Registry menu. It allows users to write CEL (Common Expression
Language) expressions to query registrants. The module has no Python
models — it is a frontend-only OWL component that calls
spp.cel.service on the backend.
URL: /odoo/registry-cel Menu: Registry > Advanced Search
1.1 Module installs without errors
- Go to Apps
- Search for "CEL Registry Search"
- Verify the module is listed with status "Installed"
- Verify no errors in the server log related to this module
Expected: Module is installed and functional.
1.2 Menu visible to Registry Officer
- Log in as a user with the Registry Officer role
- Click the Registry top menu
Expected: "Advanced Search" menu item appears under Registry (sequence 85, typically near the bottom of the menu).
1.3 Menu not visible to base user
- Log in as a base user who does NOT have the Registry Officer, Registry Manager, or CEL Search User group
- Click the Registry top menu (if visible)
Expected: "Advanced Search" menu item does NOT appear. The user should not have access to the CEL search portal.
1.4 Menu visible to CEL Search User
- Assign a user the CEL Search User group (without Registry Officer)
- Log in as that user
- Navigate to Registry
Expected: "Advanced Search" menu item appears. This user should also have Registry Viewer permissions (implied by the CEL Search User group).
2.1 Page loads correctly
- Navigate to Registry > Advanced Search (or go to
/odoo/registry-cel)
Expected:
- Page title: "Advanced Search" with a code icon
- A card containing:
- Profile dropdown defaulting to "Individuals"
- CEL Expression label with an empty code editor
- Search button (disabled)
- Clear button (disabled)
- Below the card: an empty state with:
- A large code icon (faded)
- Text: "Search with CEL Expressions"
- Text: "Write a CEL expression to filter registrants, then click Search."
- Three example expressions:
age_years(r.birthdate) >= 18- Adults 18+is_female(r.gender_id)- Femalesr.registration_date > "2024-01-01"- Recent registrations
2.2 Profile dropdown options
- Click the Profile dropdown
Expected: Two options: "Individuals" and "Groups". "Individuals" is selected by default.
3.1 Editor accepts input
- Click inside the CEL expression editor
- Type:
r.name != ""
Expected:
- Text appears in the editor with syntax highlighting
- The Search button becomes enabled
- The Clear button becomes enabled
- A validation indicator appears (green checkmark with match count if valid)
3.2 Autocomplete and symbol browser
- Clear the editor
- Type:
r.(with the dot)
Expected: An autocomplete dropdown appears showing available fields
(e.g., name, birthdate, gender_id, phone, email,
registration_date, disabled, etc.).
3.3 Toolbar and symbol browser visibility
- Look at the editor area
Expected: A toolbar is visible above the editor. A symbol browser panel is available for browsing available fields and functions.
3.4 Invalid expression feedback
- Type an invalid expression:
r.name ===
Expected:
- A red error indicator appears (red X icon)
- The error message describes the syntax issue
- The Search button is disabled (cannot search with invalid expression)
3.5 Validation match count
- Type a valid expression:
r.name != ""
Expected: A green checkmark appears with a count like "X match(es)" showing how many registrants match before you execute the search.
4.1 Basic search with results
- Set profile to Individuals
- Type:
r.name != "" - Click Search
Expected:
- A loading spinner appears briefly with "Searching..." text
- Results appear showing "X Result(s) Found" (or "Showing 50 of X Result(s)" if more than 50)
- Each result shows:
- Registrant name
- Type badge: "Individual" with a person icon
- Registration date (right side)
- Phone number (if present, with phone icon)
- Email (if present, with envelope icon)
- A right chevron indicating the row is clickable
4.2 Search with no results
- Type an expression that matches nothing:
r.name == "ZZZZNONEXISTENT999" - Click Search
Expected:
- Result section shows: "0 Result(s) Found"
- An info alert appears: "No registrants found matching your CEL expression."
4.3 Result limit (50 records)
- Type an expression that matches many registrants:
r.name != "" - Click Search
Expected: If more than 50 matches exist:
- Header shows: "Showing 50 of X Result(s)"
- Only 50 results are displayed in the list
4.4 Click a result to open form
- Perform a search that returns results
- Click on any result row
Expected: The individual's form view opens (the standard Individual
form from spp_registry). You should be able to navigate back using
the browser back button or breadcrumbs.
4.5 Disabled registrant display
- Ensure at least one registrant is disabled (has
disabled = True) - Search with an expression that includes disabled registrants
Expected: Disabled registrants appear in the list with:
- Muted text (gray, reduced opacity)
- A yellow "Disabled" badge with a ban icon next to the name
- The row is still clickable and opens the form view
5.1 Switch to Groups profile
- Change the Profile dropdown to "Groups"
Expected:
- The dropdown shows "Groups" as selected
- If there was an expression in the editor, validation re-runs for the Groups profile
- The editor may show different autocomplete options appropriate for groups
5.2 Search groups
- With "Groups" selected, type:
r.name != "" - Click Search
Expected:
- Results show group registrants
- Each result shows type badge: "Group" with a people icon (fa-users)
- Clicking a result opens the Group form view (with membership tab)
5.3 Profile switch triggers re-validation
- Type a valid expression with "Individuals" selected
- Note the validation status (green checkmark)
- Switch to "Groups"
Expected: The validation re-runs. The expression may still be valid (if it uses fields common to both profiles) or may become invalid (if it uses individual-specific fields).
6.1 Clear after search
- Perform a search that returns results
- Click Clear
Expected:
- The expression editor is emptied
- The results section disappears
- The empty state (with examples) reappears
- The Search button is disabled
- The Clear button is disabled
6.2 Clear with expression but no search
- Type an expression but do NOT click Search
- Click Clear
Expected:
- The expression editor is emptied
- The empty state remains (no results were shown)
- Both buttons are disabled
7.1 Backend error
- Type an expression that causes a backend error (e.g., reference a
field that does not exist and somehow bypasses validation):
r.nonexistent_field_xyz > 0
Expected:
- A red error notification appears with the error message
- The page returns to the empty state (does NOT show "0 Result(s) Found")
- The expression remains in the editor so the user can fix it
7.2 Empty expression warning
- Clear the editor completely
- If the Search button is somehow clickable, click it
Expected: The Search button should be disabled when the expression is empty. If triggered programmatically, a warning notification appears: "Please enter a CEL expression to search."
7.3 Invalid expression warning
- Type an invalid expression (e.g.,
r.name ===) - If the Search button is somehow clickable, click it
Expected: The Search button should be disabled when the expression is invalid. If triggered programmatically, a warning notification appears: "Please fix the expression errors before searching."
8.1 Hover effect on results
- Perform a search that returns results
- Hover your mouse over a result row
Expected: The row background changes to a slightly darker shade (light gray), indicating it is clickable.
8.2 Responsive layout
- Resize the browser window to a narrow width (< 768px)
Expected:
- The page remains usable
- The header font size reduces
- The profile dropdown takes full width
- Result items stack gracefully
8.3 Page scrolling
- Perform a search that returns many results (close to 50)
- Scroll down the page
Expected: The page scrolls smoothly. The results list does not get clipped or overflow incorrectly.
9.1 Direct URL access without permission
- Log in as a base user who does NOT have the CEL Search User or Registry Officer group
- Navigate directly to
/odoo/registry-cel
Expected: The user should either see an access error or be redirected. They should NOT be able to use the search portal.
9.2 CEL Search User can only view (not edit) registrants
- Log in as a user with ONLY the CEL Search User group
- Perform a search and click a result to open the form
Expected: The registrant form opens in read-only mode. The user should be able to view but not modify the registrant (since CEL Search User only implies Registry Viewer, not Officer).
| # | Test | Pass/Fail |
|---|---|---|
| 1.1 | Module installs without errors | |
| 1.2 | Menu visible to Registry Officer | |
| 1.3 | Menu not visible to base user | |
| 1.4 | Menu visible to CEL Search User | |
| 2.1 | Page loads with correct empty state | |
| 2.2 | Profile dropdown has correct options | |
| 3.1 | Editor accepts input and enables Search | |
| 3.2 | Autocomplete works | |
| 3.3 | Toolbar and symbol browser visible | |
| 3.4 | Invalid expression shows error | |
| 3.5 | Validation shows match count | |
| 4.1 | Individual search returns results | |
| 4.2 | Search with no results shows info alert | |
| 4.3 | Result limit (50) works correctly | |
| 4.4 | Clicking result opens Individual form | |
| 4.5 | Disabled registrant displayed correctly | |
| 5.1 | Profile switch to Groups works | |
| 5.2 | Groups search returns group results | |
| 5.3 | Profile switch triggers re-validation | |
| 6.1 | Clear after search resets everything | |
| 6.2 | Clear with expression but no search | |
| 7.1 | Backend error shows notification, returns to empty state | |
| 7.2 | Empty expression warning | |
| 7.3 | Invalid expression warning | |
| 8.1 | Hover effect visible on result rows | |
| 8.2 | Responsive layout on narrow screens | |
| 8.3 | Page scrolling works correctly | |
| 9.1 | Direct URL access denied without permission | |
| 9.2 | CEL Search User has read-only access |
- Initial migration to OpenSPP2
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
- OpenSPP.org
- OpenSPP Community
Current maintainers:
This module is part of the OpenSPP/OpenSPP2 project on GitHub.
You are welcome to contribute.





