Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2550 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
feb 25
1423
0
dic 24
46
0
dic 24
1235
1
ott 24
2582
2
ago 24
1743