Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
78 Visninger

i've made a rule of sales representative that he can only see his state contacts (contacts which are doctor, dealer, homecare, sleepcenter, rehab center, hospital) no other contact , now what I basically want is that the particular contact must be seen by him(sales rep.) only when that sales representative is assigned as a salesperson only. So, what will be the record rule ?


<record id='rule_partner_contact' model="ir.rule">

<field name="name">Partner Contact</field>

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

<field name="groups" eval="[(4, ref('sanrai_permission.group_sales_representative')), (4, ref('sanrai_permission.group_mother_child_sales_manager')), (4, ref('sanrai_permission.group_zonal_sales_manager'))]"/>

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

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

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

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

<field name="domain_force">[

'|',

('id', '=', user.partner_id.id),

'&amp;',

('employee_ids', '=', False),

'|',

('state_id', '=', user.company_id.state_id.id),

('state_id', '=', False),

'|',

('user_id', '=', user.id),

('user_id', '=', False),

]

</field>

</record>

this is the particular code of record rule

Avatar
Kassér