我已经为机会和销售订单创建了两条记录规则,首先我希望只有团队负责人才能看到他团队的所有线索,其次我只想草拟状态销售订单以显示任何用户。
因此,创建了两个记录规则,如下所示,有人可以帮助我同样无法正常工作,只有销售人员允许查看潜在客户,不允许团队领导。
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="sale_security_opportunities" model="ir.rule">
<field name="name">See Teams Leads</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="global" eval="True"/>
<field name="domain_force">['&','|','|',('section_id.user_id','=',user.id), ('section_id.member_ids', 'in', [user.id]),('user_id','=',user.id),('user_id','=',False)]</field>
</record>
<!--For See Only Quatations Group And Record Rule-->
<record id="group_see_only_quotation" model="res.groups">
<field name="name">See Only Quotation</field>
<field name="comment">Thsi User Can Only Leads,Opportunities and Quotations.</field>
</record>
<record id="sale_security_sale_quatation" model="ir.rule">
<field name="name">Quotation Only</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="global" eval="True"/>
<field name="domain_force">[('state','=','draft')]</field>
<field name="groups" eval="[(4,ref('my_module.group_see_only_quotation'))]"/>
</record>
</data>
</openerp>