Help

7

How to do record rule for same object with different menu

Avatar
Annadurai

<record model="ir.rule" id="sales_team_partner_access"> <field name="name">Sales Team Partner Access</field> <field name="model_id" ref="base.model_res_partner" /> <field name="domain_force">['|',('team_id.user_id','=',user.id),('team_id.member_ids','=', user.id)]</field> </record>

this rule is applied for contacts. its used for showing customer who having same sales team for user.

but in purchase, its only showing vendors whos having same sales team for the user. 

What i need is, I want to show all vendors whose having sales team or without sales team.

Is it possible to achieve it by menu??????????????? 

Avatar
Discard
1 Answer
2
Avatar
Janarthanan
Best Answer

Hi @annadurai try this

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

<field name="name">Partner Own Documents</field>
<field name="model_id" ref="base.model_res_partner" />
<field name="domain_force">['|','|',
('user_ids','in',[user.id]),
('supplier','=',True),
'&amp;','&amp;','&amp;',
('user_id','!=',False),
('user_id','=',user.id),
('team_id','!=',False),
('team_id','=',user.team_id.id)]
</field>
<field name="groups" eval="[(6, 0, [ref('sales_team.group_sale_salesman')])]" />
</record>

Avatar
Discard