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

Hi Community, I want to add a condition based on xml id inside domain force.The ref() funtion is not working inside domain force.Please help me out.
below is my record rule, here I need to add the id of 'base.poratl_user_template' 
 inside this condition [('id', 'in', [user.partner_id.id,user.company_id.partner_id.id])

<record model="ir.rule" id="res_partner_rule_company">
<field name="name">Company Rule for Customers</field>
<field name="model_id" ref="model_res_partner"/>
<field name="groups" eval="[(4, ref('base_company.company_subcompany_user'))]"/>
<field name="domain_force">
['|',('company_id','=',user.company_id.id),('id', 'in', [user.partner_id.id,
user.company_id.partner_id.id])]
</field>
<field name="perm_create" eval="True"/>
</record>
الصورة الرمزية
إهمال
أفضل إجابة

Hello Muhammed Nishad

you can use like this..
<field name="domain_force" eval="[('id', 'in', ref('base.poratl_user_template').ids)]"/>


الصورة الرمزية
إهمال
أفضل إجابة

Hi, 
for that  we use EVAL.
Hope this helps:

<field name="domain_force" eval="[('id', '=', ref(''))]"/>
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أبريل 20
3079
4
مايو 24
12613
1
أبريل 24
3250
2
يناير 24
3167
0
يناير 24
1507