Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3753 มุมมอง

Hi,

Is it possible to limit the access of field using record rules ?

I created a group 'basic user' for the 'project' module.

I want the users to be able to create a task but I don't want to let them assign the task to someone else. The user should be self assigned to the task he created.

What would be the best way to do this ?


Regards

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

The field user_id is assigned by default to the current user so it will be assigned to the creator. If the assigned to field will not change by anyone you can set it to read only and force_save to 1.

อวตาร
ละทิ้ง

<record id="project_task_form_inherit_assigned" model="ir.ui.view">
<field name="name">project.task.form.inherit</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<field name="user_id" position="attributes">
<attribute name="readonly">1</attribute>
<attribute name="force_save">1</attribute>
</field>

</field>
</record>

<record id="quick_create_task_form_inherit_assigned" model="ir.ui.view">
<field name="name">project.task.form.quick_create.inherit</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.quick_create_task_form"/>
<field name="priority">1000</field>
<field name="arch" type="xml">
<field name="user_id" position="attributes">
<attribute name="readonly">1</attribute>
<attribute name="force_save">1</attribute>
</field>
</field>
</record>

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ค. 20
8090
How to define user groups? แก้ไขแล้ว
1
ธ.ค. 22
10540
0
เม.ย. 20
3116
0
ก.พ. 19
2700
0
มิ.ย. 18
3017