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
2894 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
1574
1
led 25
2351
1
srp 24
2473
2
kvě 24
1921
3
kvě 24
12156