Skip to content

Commit

Permalink
Merge pull request #33 from hbrunn/15.0-20-user-groups
Browse files Browse the repository at this point in the history
[ADD] #20 standard user groups
  • Loading branch information
albig authored Oct 2, 2023
2 parents 6c9c6a5 + 8407d88 commit 492e63e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
3 changes: 3 additions & 0 deletions verdigado_attendance/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"views/hr_leave_type.xml",
"views/hr_menu_human_resources_configuration.xml",
],
"demo": [
"demo/res_users.xml",
],
"assets": {
"web._assets_primary_variables": [
"verdigado_attendance/static/src/scss/primary_variables.scss",
Expand Down
26 changes: 26 additions & 0 deletions verdigado_attendance/demo/res_users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="verdigado_user" model="res.users" context="{'no_reset_password': True}">
<field name="login">verdigado_employee</field>
<field name="name">Verdigado employee</field>
<field name="groups_id" eval="[(6, 0, [ref('group_verdigado_employee')])]" />
</record>
<record
id="verdigado_officer"
model="res.users"
context="{'no_reset_password': True}"
>
<field name="login">verdigado_officer</field>
<field name="name">Verdigado officer</field>
<field name="groups_id" eval="[(6, 0, [ref('group_verdigado_officer')])]" />
</record>
<record
id="verdigado_manager"
model="res.users"
context="{'no_reset_password': True}"
>
<field name="login">verdigado_manager</field>
<field name="name">Verdigado manager</field>
<field name="groups_id" eval="[(6, 0, [ref('group_verdigado_manager')])]" />
</record>
</odoo>
28 changes: 28 additions & 0 deletions verdigado_attendance/security/verdigado_attendance.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- groups -->
<record id="module_category_verdigado" model="ir.module.category">
<field name="name">Verdigado</field>
</record>
<record id="group_verdigado_employee" model="res.groups">
<field name="name">Employee</field>
<field name="category_id" ref="module_category_verdigado" />
<field
name="implied_ids"
eval="[(6, 0, [ref('hr_attendance.group_hr_attendance'), ref('base.group_user')])]"
/>
</record>
<record id="group_verdigado_officer" model="res.groups">
<field name="name">Officer</field>
<field name="category_id" ref="module_category_verdigado" />
<field
name="implied_ids"
eval="[(6, 0, [ref('group_verdigado_employee'), ref('hr.group_hr_user'), ref('hr_attendance.group_hr_attendance_user'), ref('hr_holidays.group_hr_holidays_user')])]"
/>
</record>
<record id="group_verdigado_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="module_category_verdigado" />
<field
name="implied_ids"
eval="[(6, 0, [ref('group_verdigado_officer'), ref('hr.group_hr_manager'), ref('hr_attendance.group_hr_attendance_manager'), ref('hr_holidays.group_hr_holidays_manager')])]"
/>
</record>
<!-- hr.employee -->
<record id="rule_hr_employee_user" model="ir.rule">
<field name="name">Restrict HR users to their own employees</field>
Expand Down

0 comments on commit 492e63e

Please sign in to comment.