コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2581 ビュー

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

アバター
破棄
最善の回答

Use SQL constraints on model


class PosOrder(models.Model):
_inherit = "pos.order"

    _sql_constraints = [('name_uniq', 'unique (name)', "Order with this name already exists!"), ] 
アバター
破棄
関連投稿 返信 ビュー 活動
3
4月 25
1282
1
1月 25
1926
1
8月 24
2080
2
5月 24
1593
3
5月 24
11276