Skip to Content
मेन्यू
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
अप्रैल 25
1350
1
जन॰ 25
1974
1
अग॰ 24
2147
2
मई 24
1612
3
मई 24
11385