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
946
1
Jan 25
1760
1
Aug 24
1730
2
May 24
1444
3
May 24
10848