Skip to Content
Menu
This question has been flagged
1 Odpoveď
2540 Zobrazenia

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

Avatar
Zrušiť
Best Answer

Use SQL constraints on model


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

    _sql_constraints = [('name_uniq', 'unique (name)', "Order with this name already exists!"), ] 
Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
3
apr 25
1217
1
jan 25
1895
1
aug 24
1995
2
máj 24
1565
3
máj 24
11195