I want to allow a record in one2many tree view and allow to delete a record in one2many tree view based on its state.
For example: if state!='draft', disable the delete icon.
It is for account.invoice.line model.
I try to override the fields_view_get method, but It does not work.
I try to override the ir.rule, but the result is the same and the delete icon always displays.