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

Would like to ask any solutions for prevent duplicates in DB to format the API call? 

아바타
취소
베스트 답변

Use SQL constraints on model


class PosOrder(models.Model):
_inherit = "pos.order"

    _sql_constraints = [('name_uniq', 'unique (name)', "Order with this name already exists!"), ] 
아바타
취소
관련 게시물 답글 화면 활동
3
4월 25
1344
1
1월 25
1949
1
8월 24
2130
2
5월 24
1602
3
5월 24
11338