Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3943 Näkymät

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?

Avatar
Hylkää

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

Tekijä

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
toukok. 18
5847
2
marrask. 17
14608
1
syysk. 17
5637
2
heinäk. 25
4527
2
jouluk. 24
7698