Skip to Content
Menu
This question has been flagged

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

Avatar
Discard
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
Discard
Related Posts Replies Views Activity
3
Apr 25
860
1
Jan 25
1711
1
Aug 24
1673
2
May 24
1384
3
May 24
10705