Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Issue with Access Rules for Attachments / odoo 17

形象
丢弃
4 答案
0
形象
odoo
最佳答案

This is a bug I've just found and reported to Odoo (link here)

Until Odoo will fix this, I've just applied a custom fix on my model in the create method like:


@api.model_create_multi
def create(self, vals_list):
    recs = super().create(vals_list)
    for rec in recs:
        rec.attachment_ids.update({
            'res_model': self._name,
            'res_id': rec.id,
        })
        return recs

You can retroactively fix existing records in the same manner through a similar script

Hope it helps ;)

形象
丢弃
0
形象
odoo
最佳答案

I have the same problem. Non-admin users get a read access error when trying to create a record in Odoo 17.
This is a bug which should be fixed asap.

How did you fix that?

形象
丢弃
0
形象
odoo
最佳答案

But this is not working

形象
丢弃
0
形象
odoo
最佳答案
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_add_attachment,add.attachment,model_add_attachment,,1,1,1,1

I think you should try to add base.group_user here or try to create a admin group for your module and add it to your security

2 注释
形象
丢弃
形象
odoo
-

this is not working

形象
odoo
-

you can try send your code to me so i can check when i free