Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have created a domain_force to sort out contacts through sale_teams or sales_person.
in preference, I set sales_team "team_id". if the user salesteam is "direct sales" then the contacts having same sales_team " directsales" then it only show corresponding contacts.
<odoo> <data noupdate="0"> <record model="ir.rule" id="ir_my_custom_rule"> <field name="name">salesteamaccess</field> <field name="model_id" ref="base.model_res_partner"/> <field name="domain_force">['|','|',('user_id','=',user.id),('user_id','=',False),('team_id','=', [user.team_id])]</field> </record> </data> </odoo>
|but this doesnt work well as per need. If I logged in different user then it shows maximum reccurssive occured error.|
please check 2 considerations:
This leaf ('team_id','=', [user.team_id]) is incorrect. You compare Team ID with a list of objects. It should be either ('team_id','=', user.team_id.id) or ('team_id','in', [user.team_id.id])
You apply a global rule for all user groups. It is better to overwrite some existing rule - e.g. res_partner_rule
About This Community
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 1/30/17, 5:33 AM|
|Seen: 491 times|
|Last updated: 5/3/18, 6:51 AM|