resource_security.xml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo noupdate="1">
  3. <record model="ir.rule" id="resource_calendar_leaves_rule_group_user_create">
  4. <field name="name">resource.calendar.leaves: employee reads own or global</field>
  5. <field name="model_id" ref="model_resource_calendar_leaves"/>
  6. <field name="groups" eval="[(4, ref('base.group_user'))]"/>
  7. <field name="domain_force">['|', ('resource_id', '=', False), ('resource_id.user_id', 'in', [False, user.id])]</field>
  8. <field name="perm_write" eval="False"/>
  9. <field name="perm_create" eval="False"/>
  10. <field name="perm_unlink" eval="False"/>
  11. </record>
  12. <record model="ir.rule" id="resource_calendar_leaves_rule_group_user_modify">
  13. <field name="name">resource.calendar.leaves: employee modifies own</field>
  14. <field name="model_id" ref="model_resource_calendar_leaves"/>
  15. <field name="groups" eval="[(4, ref('base.group_user'))]"/>
  16. <field name="domain_force">[('resource_id', '!=', False), ('resource_id.user_id', 'in', [False, user.id])]</field>
  17. <field name="perm_read" eval="False"/>
  18. </record>
  19. <record model="ir.rule" id="resource_calendar_leaves_rule_group_admin_modify">
  20. <field name="name">resource.calendar.leaves: admin modifies global</field>
  21. <field name="model_id" ref="model_resource_calendar_leaves"/>
  22. <field name="groups" eval="[(4, ref('base.group_erp_manager'))]"/>
  23. <field name="domain_force">[('resource_id', '=', False)]</field>
  24. <field name="perm_read" eval="False"/>
  25. </record>
  26. <record id="resource_resource_multi_company" model="ir.rule">
  27. <field name="name">resource.resource multi-company</field>
  28. <field name="model_id" ref="model_resource_resource"/>
  29. <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
  30. </record>
  31. <record model="ir.rule" id="resource_calendar_leaves_rule_multi_company">
  32. <field name="name">resource.calendar.leaves: multi-company rule</field>
  33. <field name="model_id" ref="model_resource_calendar_leaves"/>
  34. <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
  35. </record>
  36. </odoo>