Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2584 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
dub 25
1295
1
led 25
1933
1
srp 24
2091
2
kvě 24
1595
3
kvě 24
11285