Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2551 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 25
1427
0
thg 12 24
46
0
thg 12 24
1240
1
thg 10 24
2583
2
thg 8 24
1747