Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
2394 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
948
1
jan. 25
1760
1
avg. 24
1730
2
maj 24
1445
3
maj 24
10850