diff options
| author | Lucas Lefèvre <lul@odoo.com> | 2019-08-02 15:02:39 +0200 |
|---|---|---|
| committer | Lucas Lefèvre <lul@odoo.com> | 2019-11-22 16:58:38 +0100 |
| commit | 8f3a5068ca6c5e65fb97b968701c5c883eb5c132 (patch) | |
| tree | a0f299484a8bbec5bf338456c5c3caa93492ddbd /addons/hr_holidays/views | |
| parent | d813873f6c841feea361a9e4f761a9324ff7c956 (diff) | |
[IMP] hr_holidays: Add specific approval for allocations
Purpose
=======
We want to allow different approvals for allocations and leaves of a same type.
e.g. In case of compensation days, a manager would approve the
allocation request, but would later not approve leave requests.
Specification
=============
Allocation modes
----------------
No change here except renames.
1. No limit (employee doesn't need an allocation to request a leave)
2. Allow employee requests
3. Fixed by Time Off Officer
Allocation approval
-------------------
A radio field to choose the approval mechanism
appears if the employee is allowed to request an allocation.
The following approval modes are possible:
1. Time Off Officer
2. Employee's Time Off Manager (leave_responsible_id)
3. Employee's Time Off Manager and Time Off Officer
These options are the same as leave approval options
(except the missing "No Validation").
If option 1 or 2 is selected, a o2m field should
allow to select which Time Off Officer is responsible
for approving those allocations.
Allocation approval policy is the same as the leave approval policy.
Task id: 1936742
Access rights based on task 1950998
Diffstat (limited to 'addons/hr_holidays/views')
| -rw-r--r-- | addons/hr_holidays/views/hr_leave_type_views.xml | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/addons/hr_holidays/views/hr_leave_type_views.xml b/addons/hr_holidays/views/hr_leave_type_views.xml index 291d8636df0..a69bd1b5a01 100644 --- a/addons/hr_holidays/views/hr_leave_type_views.xml +++ b/addons/hr_holidays/views/hr_leave_type_views.xml @@ -22,7 +22,7 @@ <form string="Time Off Type"> <sheet> <div class="oe_button_box" name="button_box"> - <button class="oe_stat_button" type="object" name="action_see_days_allocated" icon="fa-archive"> + <button class="oe_stat_button" type="object" name="action_see_days_allocated" icon="fa-archive" attrs="{'invisible': [('allocation_type', '=', 'no')]}"> <div class="o_stat_info"> <field name="group_days_allocation"/> <span class="o_stat_text">Group Days Allocated</span> @@ -45,17 +45,21 @@ <field name="code" string="Payroll Code"/> <field name="request_unit" widget="radio"/> </group> - <group name="validation" string="Validation"> - <field name="validation_type" widget="radio"/> - <field name="responsible_id" attrs="{'invisible': [('validation_type', 'in', ['no_validation', 'manager'])], 'required': [('validation_type', 'in', ['hr', 'both'])]}"/> - </group> - <group name="visibility" string="Allocation"> - <field name="allocation_type" widget="radio" force_save="1"/> - </group> <group name="validity" string="Validity"> <field name="validity_start"/> <field name="validity_stop"/> </group> + <group name="allocation_validation" string="Allocation Requests"> + <field name="allocation_type" widget="radio" force_save="1"/> + <field name="allocation_validation_type" string="Approval" widget="radio" attrs="{'invisible': [('allocation_type', '!=', 'fixed_allocation')]}"/> + <field name="responsible_id" + attrs="{ + 'invisible': [('leave_validation_type', 'in', ['no_validation', 'manager']), '|', ('allocation_type', '=', 'no'), ('allocation_validation_type', '=', 'manager')], + 'required': ['|', ('leave_validation_type', 'in', ['hr', 'both']), '&', ('allocation_type', 'in', ['fixed_allocation', 'fixed']), ('allocation_validation_type', 'in', ['hr', 'both'])]}"/> + </group> + <group name="leave_validation" string="Time Off Requests"> + <field name="leave_validation_type" string="Approval" widget="radio"/> + </group> <group name="notification" string="Notification" colspan="2" groups="base.group_no_one"> <group> <field name="leave_notif_subtype_id" @@ -107,7 +111,8 @@ <field name="display_name"/> <field name="code"/> <field name="allocation_type"/> - <field name="validation_type"/> + <field name="leave_validation_type"/> + <field name="allocation_validation_type"/> <field name="validity_start"/> <field name="validity_stop"/> <field name="company_id" groups="base.group_multi_company"/> |
