+1 vote
77 views

Using odoo 12, I'm trying to make some custom fields adapted to contain specific values with regular expression Eg: 'NN C NNNNNNN' (N:numeric, C:Character).

I'm trying to make these fields contain some default values (like spaces/- ...) and allow user inputs according to regex.

Just like Key input in picture bellow:

example

in Back-end by (10.5k points) | 77 views

1 Answer

0 votes

Hi Khayreddine,

You can define -for example- five fields in python and organize them one next to the other in xml view separates by "-", and in create and write functions combine them into one field of type string.
Otherwise, you need to create a new field widget in js, check the way here.

by (3.7k points)
edited by
202 questions
179 answers
35 comments
167,086 users