Skip to Content
Menu
This question has been flagged
3 Replies
1510 Views

In versions prior to V17, we had a module that modified the access rules for attachments to provide special behavior where salespeople could view the attachments related to sales made by other salespeople.

After migrating to V17, we haven’t been able to achieve the same behavior. We’re getting an error like "Uh-oh! Looks like you have stumbled upon some top-secret records." However, it doesn’t provide any specific details about which rule might be affecting this behavior.

We also tried granting permissions in the CSV using the following:

csvCopiar códigoid,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_ir_attachment_logged_users,ir_attachment_logged_users,model_ir_attachment,base.group_user,1,1,1,1

Any insights or suggestions would be greatly appreciated!

Avatar
Discard
Best Answer

It might be related to a bug I've just hit and just reported to Odoo (link here)

Until they will fix this (which can take months) I'll apply a fix on my own for my models which I hope will work (I'll just set res_model and res_id on the attachments on the model create method)

Avatar
Discard
Best Answer

In Odoo V17, attachments (ir.attachment records) have a public field, which determines visibility. When this field is checked, only the creator of the attachment or users with admin privileges can view it. This restriction is enforced through the check method in the ir.attachment model.

public = fields.Boolean('Is Public Document')


 @api.model 

def check(self, mode, values=None): """Restricts access to ir.attachments based on the mode specified


Avatar
Discard
Best Answer

You can active debug mode to see which rule the error is saying i guess

Avatar
Discard
Related Posts Replies Views Activity
1
Jan 25
1908
5
May 25
12832
0
Nov 24
747
2
Aug 24
971
1
May 24
1914