تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1238 أدوات العرض

hi all seniors,

i need your expert advise, please guide is it ok or can be problematic in some cases? 

folder: security 

file name: ir_rule.xml

<odoo>

<data>

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

<field name="name">Lead (CRM) access by only self and supervisor</field>

<field name="model_id" ref="crm.lead"/>

<field name="domain_force">['|', '|',  ('user_id', '=', user.id), ('user_id', '=', False), ('user_id.user_ids.supervisor', '=', user.id)]</field>

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

<field name="perm_read" eval="True"/>

<field name="perm_write" eval="True"/>

<field name="perm_create" eval="True"/>

<field name="perm_unlink" eval="True"/>

</record>

</data>

</odoo>

thanks in advance.

الصورة الرمزية
إهمال
أفضل إجابة
The rule in your `ir_rule.xml` file looks logically sound for granting access to CRM leads based on ownership or supervisor relationship. However, there are a few considerations: ensure the `user_id.user_ids.supervisor` field is properly set, as incorrect relationships could cause issues. The permissions granted to the `base.group_user` group allow full access, so you might want to refine them for more granular control, especially for supervisors. Complex domain filters could impact performance, so ensure proper indexing. It's important to test the rule thoroughly across different user scenarios to ensure it behaves as expected


Thanks

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 24
2581
1
نوفمبر 22
4918
2
يوليو 22
3650
2
مايو 18
9824
2
يوليو 17
6761