콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4036 화면

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?

아바타
취소

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

작성자

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

관련 게시물 답글 화면 활동
0
5월 18
5963
2
11월 17
14722
1
9월 17
5748
2
7월 25
4776
2
12월 24
7881