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
2812 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
1523
1
led 25
2265
1
srp 24
2392
2
kvě 24
1863
3
kvě 24
12001