Enable and disable menu, is it possible?
Hi, in my custom module I've overridden the unlink method to perform a write instead so to update the value in a field (let's call it 'deleted' filed) to true. It works fine, but now I'd like to hide the delete action/menu (in other menu list at the top of the form/view) and show an undelete one (which updates the record setting deleted to false) based upon the value of the deleted field (true or false). How can I do it? The same when I'm in tree view; in the case the user selects both deleted and not deleted records both the menu should be hidden or disabled, but if he selects only one type of record (all deleted or all not deleted) the right menu (delete or undelete) should be available.