Skip to content

Commit

Permalink
[8.0.2.0.0] hr_attendance_overtime_request
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Sep 10, 2018
1 parent 2edb2df commit ed26477
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 20 deletions.
2 changes: 1 addition & 1 deletion hr_attendance_overtime_request/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Attendance Overtime Request",
"version": "8.0.1.4.0",
"version": "8.0.2.0.0",
"category": "Human Resources",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
Expand Down
4 changes: 3 additions & 1 deletion hr_attendance_overtime_request/data/ir_sequence_data.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0) -->
<openerp>
<data>

Expand All @@ -7,7 +9,7 @@
<field name="code">hr.overtime_request</field>
</record>
</data>

<data noupdate="1">
<record id="sequence_overtime_request" model="ir.sequence">
<field name="name">Overtime Request</field>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade
from openerp import api, SUPERUSER_ID


def reload_record_rule(env):
openupgrade.load_data(
env.cr,
"hr_attendance_overtime_request",
"security/ir_rule_data.xml",
mode="update"
)


@openupgrade.migrate()
def migrate(cr, version):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})

reload_record_rule(env)
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?xml version="1.0"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0) -->
<openerp>
<data>

<record id="module_attendance_overtime" model="ir.module.category">
<field name="name">Overtime Request</field>
</record>

<record id="module_attendance_overtime_visibility" model="ir.module.category">
<field name="name">Overtime Request Data Visibility</field>
</record>

</data>
</openerp>
11 changes: 5 additions & 6 deletions hr_attendance_overtime_request/security/ir_rule_data.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2015 Eficent Business and IT Consulting Services S.L.
Serpent Consulting Services Pvt. Ltd.
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0) -->
<openerp>
<data noupdate="1">
Expand All @@ -12,7 +11,7 @@
('employee_id.user_id.id','=',user.id),
]</field>
<field name="name">Overtime Request Rule for User</field>
<field name="groups" eval="[(4, ref('group_overtime_user'))]"/>
<field name="groups" eval="[(6, 0, [ref('base.group_user')])]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
Expand All @@ -26,7 +25,7 @@
('manager_id.id','child_of',user.employee_ids[0].id),
]</field>
<field name="name">Overtime Request Rule for Manager</field>
<field name="groups" eval="[(4, ref('group_overtime_supervisor'))]"/>
<field name="groups" eval="[(6, 0, [ref('group_overtime_supervisor')])]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
Expand All @@ -40,7 +39,7 @@
('department_id.manager_id.id','child_of',user.employee_ids[0].id),
]</field>
<field name="name">Overtime Request Rule for Department</field>
<field name="groups" eval="[(4, ref('group_overtime_department'))]"/>
<field name="groups" eval="[(6, 0, [ref('group_overtime_department')])]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
Expand All @@ -54,7 +53,7 @@
('company_id.id','child_of',user.company_id.id),
]</field>
<field name="name">Overtime Request Rule for Company</field>
<field name="groups" eval="[(4, ref('group_overtime_company'))]"/>
<field name="groups" eval="[(6, 0, [ref('group_overtime_company')])]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
Expand Down
11 changes: 6 additions & 5 deletions hr_attendance_overtime_request/security/res_groups_data.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?xml version="1.0"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0) -->
<openerp>
<data>

<record id="group_overtime_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="hr_attendance_overtime_request.module_attendance_overtime"/>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

<record id="group_overtime_supervisor" model="res.groups">
<field name="name">Supervisor</field>
<field name="category_id" ref="hr_attendance_overtime_request.module_attendance_overtime"/>
<field name="implied_ids" eval="[(4, ref('group_overtime_user'))]"/>
<field name="category_id" ref="hr_attendance_overtime_request.module_attendance_overtime_visibility"/>
</record>

<record id="group_overtime_department" model="res.groups">
<field name="name">Department</field>
<field name="category_id" ref="hr_attendance_overtime_request.module_attendance_overtime"/>
<field name="category_id" ref="hr_attendance_overtime_request.module_attendance_overtime_visibility"/>
<field name="implied_ids" eval="[(4, ref('group_overtime_supervisor'))]"/>
</record>

<record id="group_overtime_company" model="res.groups">
<field name="name">Company</field>
<field name="category_id" ref="hr_attendance_overtime_request.module_attendance_overtime"/>
<field name="category_id" ref="hr_attendance_overtime_request.module_attendance_overtime_visibility"/>
<field name="implied_ids" eval="[(4, ref('group_overtime_department'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2017 OpenSynergy Indonesia
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
Expand All @@ -26,7 +26,7 @@
<div name="integration">
</div>
</group>
<separator string="Overtime Request"/>
<separator string="Overtime Request"/>
<group name="overtime_config">
<label for="id" string="General"/>
<div>
Expand All @@ -38,14 +38,14 @@
<label for="id" string="Start Overtime Buffer" class="oe_inline"/>
<field name="start_overtime_buffer" widget="float_time" class="oe_inline"/>
<label for="id" string="hour(s)" class="oe_inline"/>
</div>
</div>
<div>
<label for="id" string="End Overtime Buffer" class="oe_inline"/>
<field name="end_overtime_buffer" widget="float_time" class="oe_inline"/>
<label for="id" string="hour(s)" class="oe_inline"/>
</div>
</div>
</div>
</group>
</group>
<group name="overtime_group">
<label for="id" string="Allowed Groups"/>
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0) -->
<openerp>
<data>
<record id="hr_overtime_request_view_form" model="ir.ui.view">
Expand Down Expand Up @@ -148,7 +150,7 @@
<field name="search_view_id" ref="hr_overtime_request_view_search"/>
</record>

<menuitem
<menuitem
id="hr_overtime_request_menu"
name="Overtime Request"
parent="hr_overtime_root_menu"
Expand All @@ -165,7 +167,7 @@
<field name="search_view_id" ref="hr_overtime_request_view_search"/>
</record>

<menuitem
<menuitem
id="hr_overtime_request_my_menu"
name="My Overtime Request"
parent="hr_overtime_root_menu"
Expand Down

0 comments on commit ed26477

Please sign in to comment.