Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2521 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
feb. 25
1350
0
dec. 24
46
0
dec. 24
1205
1
oct. 24
2513
2
aug. 24
1701