我需要将用户访问权限仅限于自己添加的合作伙伴。 这就是我所做的: 我的模块的security.xml:
<odoo>
<data noupdate="1">
<record model="ir.rule" id="partner_access_user_rule">
<field name="name">Parners only for editors</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="domain_force"> [('create_uid','=',user.id)] </field>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>
</data>
</odoo>
更新我已经更改了ref =“base.model_res_partner”,因为Lucas告诉我,我的模块已安装,但规则并没有在设置中提升&gt;安全&gt;“记录规则”并不适用。我通过网络界面添加了记录规则,它可以工作。我如何导出它以申请我的模块?我添加到记录规则设置的问题。
导出文件:
id,"perm_create","perm_unlink","perm_read","perm_write","domain_force","groups/id","name","model_id/id"
__export__.ir_rule_97,"True","True","True","True","[('create_uid','=',user.id)]","base.group_user","Partners only for editors","account.model_res_partner"