Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3954 Vizualizări

In my custom module I added the

application_no = fields.Char(string="Application Number") field.

_sql_constraints = [
 ('application_no_unique',
 'UNIQUE(application_no)',
 "Application Number already exist.Please specify another number or make sure the application number is correct"),

]

and I use sql constraint to shows warning.

It works correctly ,When we entered duplicate application number it will shows the warning and access of saving the record is prevented

Question


How to save the record while warning happens??

note


I think sql constraint is not suit for this. is any other method for this functionality?

Imagine profil
Abandonează

Hi, Have you tried returning a warning message in onchange for the field. It will allow you to save data

Autor

Thanks amal: I will try that, That's the best solution

Related Posts Răspunsuri Vizualizări Activitate
0
mai 18
5861
2
nov. 17
14611
1
sept. 17
5646
2
iul. 25
4548
2
dec. 24
7710