Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2595 Переглядів

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
вер. 25
192
0
лют. 25
1475
0
груд. 24
46
0
груд. 24
1292
1
жовт. 24
2630