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:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
1
ตอบกลับ
3798
มุมมอง
I've found a solution: I must override unlink method
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
Delete Blank Lines
แก้ไขแล้ว
|
|
1
ส.ค. 24
|
1849 | |
Delete Company (Odoo v14)
แก้ไขแล้ว
|
|
1
พ.ย. 23
|
4380 | |
Delete my account
แก้ไขแล้ว
|
|
3
พ.ย. 24
|
10680 | |
Selecting items for one2many relation
แก้ไขแล้ว
|
|
2
ธ.ค. 22
|
14990 | |
|
1
พ.ย. 21
|
5121 |