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
1398
1
Jan 25
2042
1
Aug 24
2201
2
May 24
1677
3
May 24
11574