Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
1860 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Melhor resposta

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
Cancelar
Melhor resposta

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

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
jan. 25
2267
5
jun. 25
14229
0
nov. 24
963
2
ago. 24
1190
1
mai. 24
2218