Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
1444 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
led 25
1773
5
kvě 25
12607
0
lis 24
701
2
srp 24
938
1
kvě 24
1822