Skip to Content
Menu
This question has been flagged
1 Atsakyti
2562 Rodiniai

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

Portretas
Atmesti
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!"), ] 
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
bal. 25
1254
1
saus. 25
1900
1
rugp. 24
2030
2
geg. 24
1578
3
geg. 24
11224