Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I am using odoo 9. I am working in a view with a one2many field. The one2many field tree view list, there is a trash icon on the left of each row. When I click on the trash icon, I would like to intercept record deletion and perform some custom action.
I tried to override unlink method but it does not break into the break point set inside the unlink so I think odoo is not calling unlink. Any idea?
The view is view_pack_operation_lot_form. Here is my method:
# do my stuff
It is not clear from you question whether you are calling the Unlink method of Child or Parent object.
Anyways In case of One2many, Deleting depends on the record's storage mode, i.e
deletion upon saved lines (physical records)
deletion upon unsaved records (cache records)
Hence when you calling Unlink method of Child Object, this will work well w.r.t Physical Records, but not on Cache records, which are not saved to the database.
So the alternate solution would be to deal with the One2many field values which you will receive in the Write Values of Parent Object.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 11/8/16, 3:26 AM|
|Seen: 466 times|
|Last updated: 11/10/16, 10:52 AM|