Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3988 Visualizzazioni

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:

base.access_ir_attachment_group_user,access_ir_attachment group_user,base.model_ir_attachment,base.group_user,1,1,1,0

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:
- Sales/Manager
- Project/Manager

(Document model: ir.attachment)

Avatar
Abbandona
Risposta migliore

Hello Pranav,

Can you please check what are all the access rights available for it.attachment model

you will get it from Setting --> Technical --> Database structure --> model     (visible only dedug mode)

after that change what are all the groups mapped to the current user.

After observing these two you will get an idea.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
nov 18
2830
0
lug 16
3303
0
feb 18
3237
1
nov 17
2918
1
giu 23
3965