Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 21 |
Technical Name |
odoo_odex |
License | LGPL-3 |
Website | https://github.com/DIOR27/odex |
Versions | 15.0 16.0 17.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 21 |
Technical Name |
odoo_odex |
License | LGPL-3 |
Website | https://github.com/DIOR27/odex |
Versions | 15.0 16.0 17.0 |
Odex - The Odoo RegEx Module
Odex is a simple but powerful module for managing regular expressions in fields.
This Odoo module customizes the behavior of the Char
field by introducing a new regex
parameter. It allows you to define
a regular expression pattern that the field value must match. If the value provided does not conform to the specified
pattern, a ValidationError
is raised.
Usage
To use odex, simply add the parameter regex
together with the string to be evaluated in the char field (fields.Char
)
of your model, for example:
name = fields.Char(string=_(“Name”), regex=r"^[A-Z0-9]+$")
When not matching the regular expression, the system will display a ValidationError
indicating the value and the
expected expression.
Note: The regex
parameter is case-sensitive.
If you like my work please leave me a star on GitHub, I'd really appreciate it.
Please log in to comment on this module