Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 212 |
Technical Name |
lis_dynamic_pattern_check |
License | OPL-1 |
Website | https://www.loyalitsolutions.com |
Versions | 16.0 17.0 18.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 212 |
Technical Name |
lis_dynamic_pattern_check |
License | OPL-1 |
Website | https://www.loyalitsolutions.com |
Versions | 16.0 17.0 18.0 |
Dynamic Pattern Validation
Navigate to Settings > Technical > Validations > Regex Pattern to manage dynamic patterns.

Create a New Regex Pattern
Click on the New button to create a new pattern.

Add Name and Pattern

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

Click on the New button to create a new validation.

Here is an example:

- 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.

- 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.

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.


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


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