Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
1871 Переглядів

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!

Аватар
Відмінити
Найкраща відповідь

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)

Аватар
Відмінити
Найкраща відповідь

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


Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
січ. 25
2281
5
черв. 25
14266
0
лист. 24
968
2
серп. 24
1194
1
трав. 24
2227