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

Hello everyone!
Someone who can help me remove a rule?

The case is that I want to eliminate the rule so that a barcode is not a unique field, that is, a barcode can be selected for more than one product.

Thanks for reading the message

アバター
破棄
最善の回答

Hi,

This constrain is added by sql constrains in product module.

_sql_constraints = [
('barcode_uniq', 'unique(barcode)', "A barcode can only be assigned to one product !"),
]

To override the above constrains, in your custom module, inherit the product model and add the below constrains.

_sql_constraints = [
('barcode_uniq', 'CHECK(1=1)', "A barcode can only be assigned to one product !"),
]

Thanks

アバター
破棄
関連投稿 返信 ビュー 活動
0
2月 25
1440
0
12月 24
46
0
12月 24
1248
1
10月 24
2592
2
8月 24
1759