Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
1589 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
ene 25
2000
5
jun 25
13158
0
nov 24
796
2
ago 24
1027
1
may 24
1995