hr_attendance_security.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record model="ir.module.category" id="base.module_category_human_resources_attendances">
  4. <field name="sequence">14</field>
  5. </record>
  6. <record id="group_hr_attendance_kiosk" model="res.groups">
  7. <field name="name">User : Only kiosk mode</field>
  8. <field name="category_id" ref="base.module_category_human_resources_employees"/>
  9. <field name="comment">The user will be able to open the kiosk mode and validate the employee PIN.</field>
  10. <field name="implied_ids" eval="[(6, 0, [ref('base.group_user')])]"/>
  11. </record>
  12. <record id="hr.group_hr_user" model="res.groups">
  13. <field name="implied_ids" eval="[(4, ref('hr_attendance.group_hr_attendance_kiosk'))]"/>
  14. </record>
  15. <record id="group_hr_attendance" model="res.groups">
  16. <field name="name">User</field>
  17. <field name="category_id" ref="base.module_category_human_resources_attendances"/>
  18. <field name="comment">The user will gain access to the human resources attendance menu, enabling him to manage his own attendance.</field>
  19. </record>
  20. <record id="group_hr_attendance_user" model="res.groups">
  21. <field name="name">Officer : Manage all attendances</field>
  22. <field name="category_id" ref="base.module_category_human_resources_attendances"/>
  23. <field name="implied_ids" eval="[(4, ref('hr.group_hr_user')), (4, ref('hr_attendance.group_hr_attendance'))]"/>
  24. </record>
  25. <record id="group_hr_attendance_manager" model="res.groups">
  26. <field name="name">Administrator</field>
  27. <field name="category_id" ref="base.module_category_human_resources_attendances"/>
  28. <field name="implied_ids" eval="[(4, ref('hr_attendance.group_hr_attendance_user'))]"/>
  29. <field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
  30. </record>
  31. <record id="base.default_user" model="res.users">
  32. <field name="groups_id" eval="[(4,ref('hr_attendance.group_hr_attendance_manager'))]"/>
  33. </record>
  34. <record id="group_hr_attendance_use_pin" model="res.groups">
  35. <field name="name">Enable PIN use</field>
  36. <field name="category_id" ref="base.module_category_hidden"/>
  37. <field name="comment">The user will have to enter his PIN to check in and out manually at the company screen.</field>
  38. </record>
  39. <data noupdate="1">
  40. <record id="hr_attendance_rule_employee_company" model="ir.rule">
  41. <field name="name">Employee multi company rule</field>
  42. <field name="model_id" ref="model_hr_attendance"/>
  43. <field name="global" eval="True"/>
  44. <field name="domain_force">['|',('employee_id.company_id','=',False),('employee_id.company_id', 'in', company_ids)]</field>
  45. </record>
  46. <record id="hr_attendance_rule_attendance_manager" model="ir.rule">
  47. <field name="name">attendance officer: full access</field>
  48. <field name="model_id" ref="model_hr_attendance"/>
  49. <field name="domain_force">[(1,'=',1)]</field>
  50. <field name="groups" eval="[(4,ref('hr_attendance.group_hr_attendance_user'))]"/>
  51. </record>
  52. <record id="hr_attendance_rule_attendance_manual" model="ir.rule">
  53. <field name="name">Manual Attendance: own attendances</field>
  54. <field name="model_id" ref="model_hr_attendance"/>
  55. <field name="domain_force">[('employee_id.user_id', '=', user.id)]</field>
  56. <field name="perm_read" eval="1"/>
  57. <field name="perm_write" eval="1"/>
  58. <field name="perm_create" eval="1"/>
  59. <field name="perm_unlink" eval="0"/>
  60. <field name="groups" eval="[(4,ref('hr_attendance.group_hr_attendance'))]"/>
  61. </record>
  62. <record id="hr_attendance_rule_attendance_employee" model="ir.rule">
  63. <field name="name">user: read own attendance only</field>
  64. <field name="model_id" ref="model_hr_attendance"/>
  65. <field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
  66. <field name="perm_read" eval="1"/>
  67. <field name="perm_write" eval="0"/>
  68. <field name="perm_create" eval="0"/>
  69. <field name="perm_unlink" eval="0"/>
  70. <field name="groups" eval="[(4,ref('base.group_user'))]"/>
  71. </record>
  72. <!-- Overtime -->
  73. <record id="hr_attendance_overtime_rule_employee_company" model="ir.rule">
  74. <field name="name">Employee multi company rule</field>
  75. <field name="model_id" ref="model_hr_attendance_overtime"/>
  76. <field name="global" eval="True"/>
  77. <field name="domain_force">['|',('employee_id.company_id','=',False),('employee_id.company_id', 'in', company_ids)]</field>
  78. </record>
  79. <record id="hr_attendance_rule_attendance_overtime_manager" model="ir.rule">
  80. <field name="name">attendance officer: full access</field>
  81. <field name="model_id" ref="model_hr_attendance_overtime"/>
  82. <field name="domain_force">[(1,'=',1)]</field>
  83. <field name="groups" eval="[(4,ref('hr_attendance.group_hr_attendance_user'))]"/>
  84. </record>
  85. <record id="hr_attendance_rule_attendance_overtime_employee" model="ir.rule">
  86. <field name="name">user: read and modify own attendance only</field>
  87. <field name="model_id" ref="model_hr_attendance_overtime"/>
  88. <field name="domain_force">[('employee_id.user_id', '=', user.id)]</field>
  89. <field name="perm_read" eval="1"/>
  90. <field name="perm_write" eval="0"/>
  91. <field name="perm_create" eval="0"/>
  92. <field name="perm_unlink" eval="0"/>
  93. <field name="groups" eval="[(4,ref('base.group_user'))]"/>
  94. </record>
  95. <!-- Report -->
  96. <record id="hr_attendance_report_rule_multi_company" model="ir.rule">
  97. <field name="name">Attendance report multi company rule</field>
  98. <field name="model_id" ref="model_hr_attendance_report"/>
  99. <field name="domain_force">[('company_id', 'in', company_ids)]</field>
  100. </record>
  101. </data>
  102. </odoo>