Skip to Content
Menu
This question has been flagged
2 Replies
6560 Views

I am trying to add validation to email and phone field. I used widget = "phone" but it doesn't have any difference. The user still can store any data they want, no matter whether it's a number or not.  I tried to download Inputmask module to verify the phone number but it still doesn't work and there is no error message showed from the developer tool. Can anyone tell me why it doesn't work?


  <field widget="mask" data-inputmask-alias="phone" name="phone" />

   <field name="mobile" widget="phone"/>

  <field name="email" widget="regex_mask" data-inputmask-regex="[a-zA-Z0-9._%-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}" context="{'gravatar_image': True}" attrs="{'required': [('user_ids','!=', [])]}"/>

                          

Avatar
Discard

I tried to install all necessary packages but it still doesn't work right now. The only change is there is no error about phonenumber but still get the error message below:

Flanker is not compatible with Python 3, email validation has been disabled

Now how can I fix that? Even if the email is not working, the phone number validation should work, but it is still wrong.

Best Answer

Did you check your Odoo Server logs to verify you have the correct Python module is required?

If you are using Odoo phone validation and you don't have the correct dependency, you will see something like:

The 'phonenumbers' Python module is not available. Phone number validation will be skipped.
Avatar
Discard
Related Posts Replies Views Activity
1
Jul 24
408
1
Jul 23
3224
0
Mar 24
1987
1
Sep 22
4953
1
Mar 22
3834