Skip to Content
Menu
v 18.0 Third Party
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 212
Technical Name lis_dynamic_pattern_check
LicenseOPL-1
Websitehttps://www.loyalitsolutions.com
Versions 16.0 17.0 18.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 212
Technical Name lis_dynamic_pattern_check
LicenseOPL-1
Websitehttps://www.loyalitsolutions.com
Versions 16.0 17.0 18.0

Dynamic Pattern Validation

Navigate to Settings > Technical > Validations > Regex Pattern to manage dynamic patterns.

Regex Pattern Screenshot

Create a New Regex Pattern

Click on the New button to create a new pattern.

Create Regex Pattern Screenshot

Add Name and Pattern

Add Name and Pattern Screenshot

Access Field Value Validation

Navigate to Settings > Technical > Validations > Field Value Validation to manage field validation.

Field Value Validation Screenshot

Click on the New button to create a new validation.

Create Validation Screenshot

Here is an example:

Type Regex
  • Provide a value for the Name field.
  • Select a Model and Fields for validation.
  • Choose a Type:
    • If the type is Regex, the Regex Pattern and Error Message fields will be displayed.
  • Select a Regex Pattern from the list of predefined patterns.
  • Provide a custom Error Message to display when validation fails.
Type Custom
  • If the type is Custom, the Include and Exclude fields will be displayed.
  • Use the Include and Exclude fields to specify values (separated by commas):
    • Include: Specify values that must be present in the field.
    • Exclude: Specify values that must not be present in the field.
  • Regex or custom validations will only be applied after confirming and changing the state to Active.

Validate the model you selected in the Dynamic Pattern Check. In this example, the Employee model is used. Create a new employee by clicking the New button.

Employee Creation Screenshot

In the Employee model, the work_email field is validated. If the entered email address does not match the defined regex pattern, an error message will be displayed.

Invalid Email Format Screenshot Validation Error Message Screenshot

The following errors occur because the Include and Exclude field conditions are not satisfied.

Include Field Error Screenshot Exclude Field Error Screenshot

The record is saved only if the regex pattern, include, and exclude conditions are satisfied.

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

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.