Hello,
When I'm deleting model instance I want to check some conditions and if that conditions are true then allow deleting and if conditions are false don't allow user to delete entry.
So what I thought, __del__() method is destructor and first I was thinking to use this function but after some testings it doesn't work as I want, so I must find another way. I want to find a way to test conditions before deletion happens and decide allow or not.
If question is still unclear tell me.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
1
Odpowiedz
3716
Widoki
I've found a solution: I must override unlink method
Podoba Ci się ta dyskusja? Dołącz do niej!
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ść | |
---|---|---|---|---|
Delete Blank Lines
Rozwiązane
|
|
1
sie 24
|
1736 | |
Delete Company (Odoo v14)
Rozwiązane
|
|
1
lis 23
|
4248 | |
Delete my account
Rozwiązane
|
|
3
lis 24
|
10540 | |
Selecting items for one2many relation
Rozwiązane
|
|
2
gru 22
|
14871 | |
|
1
lis 21
|
4984 |