Create your first validation rule in four guided steps – no experience needed.
Overview
The Rule Builder Wizard is a step-by-step assistant that walks you through creating a validation rule. Instead of facing a long form with many fields, you answer simple questions one screen at a time.
This is the best way to create your very first rule.
How It Works
The wizard has four steps:
- Choose Model – pick which Odoo screen to validate
- Choose Rule Type – pick what kind of check to perform
- Configure – set the specific fields, values, and message
- Review & Create – confirm everything and create the rule
At the end, the rule is created and ready to use. You can edit it later from the Validation Rules menu.
Step-by-Step Guide
- Go to Advance Validations → Tools → Create Rule (Wizard).
- Step 1 – Model: Select the target model (e.g., Contact, Sales Order, Product). Optionally pick a profile and set the trigger.
- Click Next.
- Step 2 – Rule Type: Choose the type of validation (e.g., Required Field, Value Range, Unique Value). The wizard shows only the options relevant to your model.
- Click Next.
- Step 3 – Configure: Fill in the rule-specific settings:
- Which field(s) to check
- Min/max values, patterns, or comparison settings
- Block or Warning severity
- Your error message
- Click Next.
- Step 4 – Review: Read the summary. If everything looks correct, click Create Rule.
- The wizard closes and your new rule appears in the Validation Rules list.
- Test the rule against a real record to confirm it works as expected.
Wizard Fields
| Field Name | Description | Example |
|---|---|---|
Model |
Which Odoo record type to validate |
Contact |
Profile |
Optional profile to assign the new rule to |
Contact Data Quality |
Trigger |
When to run the rule |
On Create & Write |
Rule Type |
Kind of validation check |
Required Field |
Field(s) |
Which field(s) the rule checks |
Phone |
Severity |
Block Save or Warning Only |
Block Save |
Error Message |
What the user sees when the rule fails |
Phone number is required. |
Rule Name |
Auto-suggested name based on your choices |
Phone Required on Contact |
Field Explanations
Model
The Odoo area where this rule will be active. Choose the model that matches where your users enter the data you want to check.
Rule Type
Determines what the wizard asks in Step 3. “Required Field” is the simplest – pick this for your first rule.
Severity
For your first rules, consider starting with “Warning Only” to see how often the check would fail before switching to “Block Save.”
Rule Name
The wizard suggests a name automatically. You can change it on the review step to something your team will recognise.
Tips
- Your first rule should be simple – try “Email Required on Contacts” with Block Save.
- After creating via the wizard, open the rule form to add advanced options like “Apply When” filters.
- Use the wizard for quick creation; use the full rule form for complex rules with multiple conditions.
Common Mistakes
- Skipping the test step – always test after creating a rule to make sure it behaves correctly.
- Choosing the wrong model – double-check you selected the right screen (Contact vs. Company, Sales Order vs. Quotation).
- Not writing a clear error message – the wizard provides a default message; replace it with something helpful.