sales_team_security.xml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data noupdate="0">
  4. <record model="ir.module.category" id="module_category_sales_team">
  5. <field name="name">Sales Teams</field>
  6. <field name="sequence">2</field>
  7. </record>
  8. <record id="group_see_only_own_team" model="res.groups">
  9. <field name="name">See only own team</field>
  10. <field name="category_id" ref="sales_team_security.module_category_sales_team"/>
  11. </record>
  12. </data>
  13. <data noupdate="1">
  14. <record id="sale_order_team_rule" model="ir.rule">
  15. <field name="name">Sales Team Orders</field>
  16. <field ref="sale.model_sale_order" name="model_id"/>
  17. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), '|', ('section_id', 'in', user.sale_team_ids.ids), ('section_id', '=', False)]</field>
  18. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  19. </record>
  20. <record id="sale_order_report_team_rule" model="ir.rule">
  21. <field name="name">Sales Team Orders Analysis</field>
  22. <field ref="sale.model_sale_report" name="model_id"/>
  23. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), '|', ('section_id', 'in', user.sale_team_ids.ids), ('section_id', '=', False)]</field>
  24. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  25. </record>
  26. <record id="sale_order_line_team_rule" model="ir.rule">
  27. <field name="name">Sales Team Order Lines</field>
  28. <field ref="sale.model_sale_order_line" name="model_id"/>
  29. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), '|', ('section_id', 'in', user.sale_team_ids.ids), ('section_id', '=', False)]</field>
  30. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  31. </record>
  32. <record id="res_partner_team_rule" model="ir.rule">
  33. <field name="name">Sales Team Partners</field>
  34. <field ref="base.model_res_partner" name="model_id"/>
  35. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), '|', ('section_id', 'in', user.sale_team_ids.ids), ('section_id', '=', False)]</field>
  36. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  37. </record>
  38. <record id="crm_lead_team_rule" model="ir.rule">
  39. <field name="name">Sales Team Leads/Opportunities</field>
  40. <field ref="crm.model_crm_lead" name="model_id"/>
  41. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), '|', ('section_id', 'in', user.sale_team_ids.ids), ('section_id', '=', False)]</field>
  42. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  43. </record>
  44. <record id="crm_lead_report_team" model="ir.rule">
  45. <field name="name">Sales Team Leads Analysis</field>
  46. <field ref="crm.model_crm_lead_report" name="model_id"/>
  47. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), '|', ('section_id', 'in', user.sale_team_ids.ids), ('section_id', '=', False)]</field>
  48. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  49. </record>
  50. <record id="crm_phonecall_team_rule" model="ir.rule">
  51. <field name="name">Sales Team Phone Calls</field>
  52. <field ref="crm.model_crm_phonecall" name="model_id"/>
  53. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), '|', ('section_id', 'in', user.sale_team_ids.ids), ('section_id', '=', False)]</field>
  54. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  55. </record>
  56. <record id="crm_phonecall_report_team" model="ir.rule">
  57. <field name="name">Sales Team Phone Calls Analysis</field>
  58. <field ref="crm.model_crm_phonecall_report" name="model_id"/>
  59. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), '|', ('section_id', 'in', user.sale_team_ids.ids), ('section_id', '=', False)]</field>
  60. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  61. </record>
  62. <record id="sales_team_team_rule" model="ir.rule">
  63. <field name="name">Own Sales Teams</field>
  64. <field ref="sales_team.model_crm_case_section" name="model_id"/>
  65. <field name="domain_force">['|', ('message_follower_ids', 'in', user.partner_id.ids), ('id', 'in', user.sale_team_ids.ids)]</field>
  66. <field name="groups" eval="[(4, ref('sales_team_security.group_see_only_own_team'))]"/>
  67. </record>
  68. </data>
  69. </openerp>