| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 944 |
| Technical Name |
aj_dynamic_field_validation |
| License | OPL-1 |
| Website | https://ajodoo.odoo.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 944 |
| Technical Name |
aj_dynamic_field_validation |
| License | OPL-1 |
| Website | https://ajodoo.odoo.com |
Dynamic Field Validation for Odoo 18
Enforce data quality across any Odoo model — no coding required. Configure powerful field-level validation rules visually, including regex patterns, length limits, numeric ranges, date ranges, uniqueness and more. Every rule is checked automatically on save, with clear error messages.
Menu Structure
All configuration is accessible under Settings → Technical → Dynamic Field Validation.
Dynamic Field Validation menu with Field Validation, Regex Patterns and Validation Logs
Regex Patterns
Create and manage reusable regex patterns with a name and description. Ready-to-use patterns are pre-loaded on install — Email, Phone (International), Phone (Local), URL, Numeric Only, Alphanumeric, ZIP Code and IP Address. Patterns can be activated or deactivated anytime and reused across multiple field validation rules.
Regex Patterns list with pre-loaded patterns available on install
Field Validation Configuration
Select any Odoo model and create a named validation rule set for it. Give it a description for easy identification. Toggle it on or off at any time without deleting the configuration — when disabled, none of its rules are enforced.
Field Validation form showing model selection and field validation lines
Per-Field Rules
Each field in the model can have its own independent set of rules. Rules are grouped by type in a clean tabbed form — Text Rules, Numeric Range, Date Range, and General Rules.
- Regex — The field value must match one or more selected patterns (e.g. must be a valid email format)
- Must Include — Certain characters or strings must be present in the value (e.g.
@and.comfor an email) - Must Avoid — Certain characters are completely blocked from the value (e.g.
#,$,%) - Minimum Length — The value must have at least a certain number of characters
- Maximum Length — The value cannot exceed a certain number of characters
- Uppercase / Lowercase / Title Case — The value must follow a specific casing format
- Numeric Minimum — A number field cannot go below a set value
- Numeric Maximum — A number field cannot exceed a set value
- Date From — A date field cannot be before a specified date
- Date To — A date field cannot be after a specified date
- Mandatory — The field cannot be left empty when saving
- Conditional Mandatory — The field becomes required only when another field has a specific value (e.g. VAT number required only when Customer Type = Company)
- Unique Value — The same value cannot exist in two records of the same model
- Custom Error Message — Each rule can have its own custom error message instead of the default one
Field Validation Line form — Text Rules tab showing regex, include, avoid, length and case options
Field Validation Line form — General Rules tab showing mandatory, uniqueness, trigger condition, state-based and group rules
Conditional Validation
Rules can be made conditional so they only fire when it makes sense, reducing unnecessary friction for users.
- Trigger Condition — A validation rule is applied only when another field on the same record has a specific value. For example, validate the phone number only if the country is India.
- State-based Rules — Rules can be restricted to specific states or stages of a record. For example, apply stricter validation only when the record is confirmed or done, not on draft.
- User Group Rules — Validation can be limited to specific user groups or bypassed for certain groups. For example, apply a rule only for sales users, or let administrators skip validation entirely.
Validation Behaviour
- Rules are checked automatically whenever a record is created or saved
- If any rule is violated, a clear error message is shown describing exactly which field failed and why
- Multiple violations are shown together in one error so the user can fix everything at once
- If a validation rule set is disabled, none of its rules are enforced
- Conditional rules are evaluated at the time of saving, so the check always reflects the current state of the record
Validation error dialog showing all failing fields with descriptions.
Validation Logs & Dashboard
Every validation failure is automatically recorded so you can monitor data quality issues across your team and models.
- Every failure is logged with timestamp, user, model, field, value attempted and the exact error message
- Logs are completely read-only — they cannot be edited or manually created
- Filter and search logs by model, field, user, or date
- A bar chart and pivot table dashboard shows which fields fail most often, helping identify recurring data quality issues
- A scheduled job runs every 7 days to automatically clean up logs older than 7 days, keeping the database clean
Validation Logs list view showing timestamp, user, model, field and error message
Features
- No Code Required — Configure all validation rules from a simple form interface
- Any Model — Apply validation rules to any standard or custom Odoo model
- Reusable Regex Library — Build a library of patterns and reuse them across multiple rules
- Pre-loaded Patterns — 8 ready-to-use regex patterns installed out of the box
- Custom Error Messages — Write meaningful messages tailored to your business context
- Conditional Rules — Trigger rules based on field values, record state, or user group
- Validation Dashboard — Bar chart and pivot table to track most failing fields
- Auto Log Cleanup — Cron job keeps log table clean automatically
- Supports All Field Types — char, text, integer, float, monetary, date, datetime
Installation
- Download and place the aj_dynamic_field_validation module in your Odoo addons directory.
- Restart the Odoo server.
- Go to Settings and activate Developer Mode.
- Navigate to Apps, search for Dynamic Field Validation, and click Install.
- Go to Settings → Technical → Dynamic Field Validation → Regex Patterns to view the pre-loaded patterns.
- Go to Field Validation, select a model, and start adding field rules.
- Save a record in that model to see validation in action.
- View failures in Validation Logs with the bar chart dashboard.
Dynamic Field Validation by Ajodoo • Built for Odoo 18 • Licensed under OPL-1
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module