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

i create a boolean field in the res.user form, and i want if the field is true, the group of users created (managers) can just read the list of contact on the res.partner 


so i create this record on my security.xml field this way;

<record id="user_ony_see_contact" model="ir.rule"> 
<field name="name">access_right_rec</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="domain_force">[('all_stores','=',True)]</field>
<field name="groups" eval="[(4, ref('group_rec_managers'))]"/>
<field name="perm_unlink" eval="0"/>
<field name="perm_write" eval="0"/>
<field name="perm_read" eval="1"/>
<field name="perm_create" eval="0"/>
</record>

i have an error which tells me that the res.partner dosent contain the field 'all_stores' which is logic, i want to know how to call it the proper way in the domain field 

thanks

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

If the goal is to make the access dependent on the manager's attribute, then why not create a separate security group, which has read access to all of the partners. And then you can add selected managers to that group, without having to create any extra fields in the model?


อวตาร
ละทิ้ง
ผู้เขียน

hello thanks for your replay

i think this dosent answer what i want to do, because i want the domain takes the value of the field that i added in the res.user

ผู้เขียน

the thing is i am trying to make a domain based on the all_store field which also based on an other field (many2many 'field_ids'), in the same res.users table, if the all_stores's value is True then the domain will be like ('field_id','in',field_ids), so i want to know just the right way to call the field in a domain from an other table

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 20
3180
1
ต.ค. 20
3443
One2many field domain not working แก้ไขแล้ว
2
ธ.ค. 21
6290
display list of product based on domain แก้ไขแล้ว
6
ส.ค. 20
7556
How to get current user in attrs? แก้ไขแล้ว
1
ธ.ค. 19
13520