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

Hi,

How to have a unique integer (  if we wante to add the same integer it should give us an error that this integer is already exist.

(usiing odoo 10)

Regards,

아바타
취소
베스트 답변

Hello,

You can use sql constrains for it. In your py file add:

_sql_constraints = [
('your_field_unique',
'UNIQUE(your_field)',
"Warning Message"),
]


아바타
취소
작성자

Sorry but it didn't work

Hi medmars,

Test it in the new db, it will work fine

작성자

Hi Niyas,

It's work perfectly when creating new database is there any method to add it on exisitng database

Thanks