res.currency.rate has this original constraint
CONSTRAINT res_currency_rate_currency_uniq UNIQUE (name)
can I override it somehow to make it a unique name for each currency and not unique name per all table
res.currency.rate has this original constraint
CONSTRAINT res_currency_rate_currency_uniq UNIQUE (name)
can I override it somehow to make it a unique name for each currency and not unique name per all table
You can add an extra param to check the uniqueness:
unique(name,currency_id)
However, take into account that it should be done in original model: in inherited models it will not work. Have also a look at - https://www.odoo.com/forum/help-1/question/remove-sql-constraints-5431 - for extra details regarding removing SQL constraints.
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
how to use constraint and sql constraint?
Rozwiązane
|
6
gru 23
|
68652 | ||
|
0
lut 16
|
4 | |||
|
0
gru 15
|
4460 | |||
|
2
mar 15
|
11913 | |||
|
1
lis 22
|
8368 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.