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
1544
1
Jan 25
2319
1
Aug 24
2418
2
May 24
1891
3
May 24
12070