Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2208 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

Use SQL constraints on model


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

    _sql_constraints = [('name_uniq', 'unique (name)', "Order with this name already exists!"), ] 
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
kwi 25
723
1
sty 25
1639
1
sie 24
1526
2
maj 24
1240
3
maj 24
10363