Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
2334 Prikazi

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

Avatar
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
3
apr. 25
892
1
jan. 25
1733
1
avg. 24
1695
2
maj 24
1401
3
maj 24
10746