[ADD] web_widget_pattern

This commit is contained in:
Holger Brunn
2024-04-23 17:17:04 +02:00
parent 5f6aa6c566
commit 7a59f5ef4d
33 changed files with 1373 additions and 0 deletions

View File

@@ -0,0 +1 @@
- Holger Brunn \<mail@hunki-enterprises.com> (https://hunki-enteprises.com)

View File

@@ -0,0 +1 @@
This module allows to use [patterns](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern) in text fields in the backend.

View File

@@ -0,0 +1,3 @@
- allow to optionally validate fields against its pattern server side
- support text, url, email, phone, ... fields
- support using a pattern from a computed field

View File

@@ -0,0 +1,13 @@
You can either define a pattern in your Python source code on a field as in
```python
my_field = fields.Char(pattern='[0-9]')
```
or on view level as in
```xml
<field name="my_field" pattern="[0-9]" />
```
Demo data adds a pattern on the street2 field on partner forms to only allow numbers.