Safely test validation rules against real records before they affect your team – nothing is saved.
Overview
The Test Rules wizard lets you run validation rules against any existing record in your database without actually saving anything. It is a “dry run” – you see which rules would pass, fail, or be skipped, but no changes are made and no logs are created.
Always test new rules before activating them for your whole team.
How It Works
You pick a model, select a real record, and choose which rules or profiles to test. Odoo runs each rule against that record and shows the result:
- Pass – the record meets the rule’s requirements
- Fail – the record would be blocked or warned
- Skipped – the rule does not apply to this record (wrong trigger, filter, or group)
Step-by-Step Guide
- Go to Advance Validations → Tools → Test Rules.
- Select the Model (e.g., Contact, Sales Order).
- Pick a Record to test against – choose a real record from your database.
- Choose what to test:
- Specific Rules, or
- An entire Profile (tests all rules in that profile)
- Click Run Test.
- Review the results table – each rule shows Pass, Fail, or Skipped with the error message that would appear.
- If a rule fails unexpectedly, click the rule name to open and adjust its settings.
- Re-run the test until all expected rules pass or fail correctly.
Testing From a Profile
You can also test directly from a Validation Profile form by clicking the Test Profile button. This opens the test wizard pre-filled with the profile’s model and rules.
Test Wizard Fields
| Field Name | Description | Example |
|---|---|---|
Model |
The record type to test against |
Contact |
Record |
A specific existing record in your database |
John Smith |
Profile |
Test all rules in a profile at once |
Contact Data Quality |
Rules |
Test specific individual rules |
Email Required, Phone Length |
Result – Status |
Pass, Fail, or Skipped for each rule |
Fail |
Result – Message |
The error message that would be shown |
Please enter an email address. |
Field Explanations
Record
Pick a real record that represents a typical case. Test with both good data (should pass) and bad data (should fail) by choosing different records.
Skipped
A rule is skipped when its “Apply When” filter, user group, company, or trigger does not match the test context. This is normal – not all rules apply to every record.
Result – Message
Shows the exact error message users would see. Use this to verify your messages are clear and helpful before going live.
Tips
- Test with at least two records: one that should pass all rules and one that should fail.
- Test line-level rules with a record that has multiple lines (e.g., a sales order with 3+ order lines).
- Test state-change rules by picking a record that is already in the target state.
- Re-test after every change to a rule’s settings.
Common Mistakes
- Testing only with perfect data – you need to test with records that should fail to confirm the rule catches problems.
- Assuming a skipped rule is broken – skipped means the rule’s conditions don’t apply to that record, which may be correct.
- Not testing before activating block rules – a misconfigured block rule can prevent an entire team from saving records.