+1 vote

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:


in Back-end by (10.5k points) | 200 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
204 questions
180 answers
268,124 users