Odoo Help

6

How to do record rule for same object with different menu

By
Annadurai
on 2/15/17, 9:04 AM 1,203 views

<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??????????????? 

1
Janarthanan
On 4/26/17, 2:54 AM

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>

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 2/15/17, 9:04 AM
Seen: 1203 times
Last updated: 5/3/18, 6:51 AM