【发布时间】:2019-04-23 10:48:56
【问题描述】:
我想根据用户组隐藏编辑、创建和删除按钮。您可以编辑 ir.model.access.csv 我尝试了所有的道路,但没有成功:
n°1:
hr.access_hr_department_user, hr.department.user, model_hr_Department, hr.group_hr_user, 1,0,0,0
n°2:
<record model="ir.ui.view" id="view_hr_department_form_groups_section">
<field name="name">edit_button</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.view_department_form"/>
<field name="groups_id" eval="[(4,ref('security_groups.group_supervisor_department') )]"/>
<field name="arch" type="xml">
<xpath expr="/form" position="attributes">
<attribute name="create">false</attribute>
<attribute name="edit">false</attribute>
</xpath>
</field>
</record>
解决方案 N°2 隐藏所有组的按钮
n°3:
<record model="ir.ui.view" id="view_hr_department_form_groups_section">
<field name="name">edit_button</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.view_department_form"/>
<field name="groups_id" eval="[(4,ref('security_groups.group_supervisor_department') )]"/>
<field name="arch" type="xml">
<form create= 'false' editable ='false' >
</form>
</field>
</record>
【问题讨论】: