Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
8107 Lượt xem

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>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Muhammed Nishad

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

<field name="domain_force" eval="[('id', '=', ref(''))]"/>
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 20
3123
4
thg 5 24
12737
1
thg 4 24
3331
2
thg 1 24
3258
0
thg 1 24
1561