Delete access issue for many2many_binary field
I have removed delete access from Employee group and its working perfectly in ir.attachment form view and tree view level, but the system is still allowing the user to remove attachment from many2many field(Access warning popup is shown, but still removing the attachment).
How to prevent a normal user from deleting a many2many_binary field?
Below is the field:
attachment_ids = fields.Many2many('ir.attachment', 'message_attachment_rel_1', 'message_id', 'attachment_id', string='Attachments', help='Attachments are linked to a document ', 'through this field.', track_visibility='always')
Below is the change in permission for Employee group:
Below is the error message:
Sorry, you are not allowed to delete this document. Only users with the following access level are currently allowed to do that:
(Document model: ir.attachment)