This module allows to use patterns in text fields in the backend.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Lets developers add a validation pattern to text fields so Odoo checks what users type and shows an error when the value does not match.
This is a technical module that adds a new option to text fields in Odoo. When a field is given a pattern, Odoo checks the value typed by the user against that pattern and refuses to accept it if it does not match.
- The pattern can be set on the field definition in the code, or directly in a view by adding a pattern attribute to a field.
- The check happens when the field is saved or parsed, and the user sees an error message saying the value does not match the required pattern.
- The module also makes the pattern available to the web client so the browser input can carry the same rule.
The module touches the base model layer, so the pattern option becomes available for text fields across Odoo. It also patches the standard character field widget in the backend, which is the input box used for short text values.
A demo view is included that applies a numeric-only pattern to the second address line of the contact form, showing how the feature is used. No new menus, reports, or scheduled actions are added; the change is limited to field validation in backend forms.
Depends on
Required by other modules
Models and fields (1)
- base · extends an existing model
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 2 confirmed, 7 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/web.
terminal Installation and usage
OCA documentation · Odoo 18.0Usage
Source · Odoo 18.0You can either define a pattern in your Python source code on a field as in
my_field = fields.Char(pattern='[0-9]')or on view level as in
<field name="my_field" pattern="[0-9]" />Demo data adds a pattern on the street2 field on partner forms to only allow numbers.
No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.