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

Hello, 

I have a group of users I would like to only see (create, update, delete) contact records that were created by them, AND, contact records created by others which have a specific field attribute (for example, field relationship = shared).


I am assuming this is to be implemented with record rules, but I am coming up short on expressing the rule to achieve that. 


I am using Odoo SaaS (Cloud). 


Any recommendations on how to best approach this scenario is greatly welcome.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks for your comment. Can this be an expression instead of writing an xml? I use Odoo SaaS in the cloud, and thought I´d be able to express this under Settings->Technical->Security->Record Rules

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

Hi,


Create record rule as follows:

<record id="rule_contact_limited_access" model="ir.rule">

    <field name="name">Contact Limited Access</field>

    <field name="model_id" ref="base.model_res_partner"/>

    <field name="domain_force">['|', ('create_uid', '=', user.id), ('relationship', '=', 'shared')]</field>

    <field name="groups" eval="[(4, ref('group_id'))]"/>

</record>


Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Security groups and record rules แก้ไขแล้ว
1
พ.ย. 24
657
0
ก.พ. 24
807
0
ส.ค. 21
1717
Restrict access by company แก้ไขแล้ว
1
มิ.ย. 19
3591
1
ก.ย. 20
5125