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

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
734
1
1月 25
1646
1
8月 24
1546
2
5月 24
1246
3
5月 24
10383