[IMP] hr_holidays: improve filters ux in the time off

The purpose of this PR is to improve the filters for time off
In Commit,
    Filters relabelling:
     - Approved Allocations -> Approved
     - Active Time Off  -> Active
     - Archived Time Off  -> Archived
     - Cancelled Time Off -> Cancelled
 - remove the `Current Year`  filter in  hr leave
 - re-sequence filter of the hr leave and and hr leave allocation

task-3090753

closes odoo/odoo#107378

Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Rohitkumar (roku)
2023-01-11 15:38:54 +01:00
parent 023473d70c
commit 0e7c7e4c78
3 changed files with 17 additions and 23 deletions
@@ -588,8 +588,6 @@ class HolidaysType(models.Model):
]
action['context'] = {
'default_holiday_status_id': self.ids[0],
'search_default_need_approval_approved': 1,
'search_default_this_year': 1,
}
return action
@@ -10,17 +10,7 @@
<field name="name"/>
<field name="allocation_type"/>
<filter domain="[('state', '=', 'confirm')]" string="To Approve" name="second_approval"/>
<filter string="Approved Allocations" domain="[('state', '=', 'validate')]" name="validated"/>
<separator/>
<filter name="active_types" string="Active Types" domain="[('holiday_status_id.active', '=', True)]" help="Filters only on allocations that belong to an time off type that is 'active' (active field is True)"/>
<separator/>
<filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]" groups="mail.group_mail_notification_type_inbox"/>
<separator/>
<filter string="My Team" name="my_team" domain="['|', ('employee_id.leave_manager_id', '=', uid), ('employee_id.user_id', '=', uid)]" help="Time off of people you are manager of"/>
<filter string="My Department" name="my_team_leaves" domain="[('employee_id.parent_id.user_id', '=', uid)]" groups="hr_holidays.group_hr_holidays_manager" help="Time Off of Your Team Member"/>
<separator/>
<filter string="Active Employee" name="active_employee" domain="[('active_employee','=',True)]"/>
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
<filter string="Approved" domain="[('state', '=', 'validate')]" name="validated"/>
<separator/>
<filter name="year" string="Current Year"
domain="[
@@ -29,6 +19,16 @@
]"
help="Active Allocations"/>
<separator/>
<filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]" groups="mail.group_mail_notification_type_inbox"/>
<separator/>
<filter string="My Team" name="my_team" domain="['|', ('employee_id.leave_manager_id', '=', uid), ('employee_id.user_id', '=', uid)]" help="Time off of people you are manager of"/>
<filter string="My Department" name="my_team_leaves" domain="[('employee_id.parent_id.user_id', '=', uid)]" groups="hr_holidays.group_hr_holidays_manager" help="Time Off of Your Team Member"/>
<separator/>
<filter name="active_types" string="Active Types" domain="[('holiday_status_id.active', '=', True)]" help="Filters only on allocations that belong to a time off type that is 'active' (active field is True)"/>
<filter string="Active Employee" name="active_employee" domain="[('active_employee','=',True)]"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
<separator/>
<filter string="My Allocations" name="my_leaves" domain="[('employee_id.user_id', '=', uid)]"/>
<separator/>
<field name="holiday_status_id"/>
+6 -10
View File
@@ -43,10 +43,9 @@
<field name="employee_id"/>
<field name="holiday_status_id"/>
<field name="name"/>
<filter domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
<filter domain="[('state', '=', 'validate1')]" string="Need Second Approval" name="second_approval"/>
<filter string="Approved Time Off" domain="[('state', '=', 'validate')]" name="validated"/>
<filter string="To Approve or Need Second Approval or Approved Time Off" domain="[('state', 'in', ('validate', 'validate1', 'confirm'))]" name="need_approval_approved"/>
<filter domain="[('state','in',('confirm','validate1'))]" string="First Approval" name="approve"/>
<filter domain="[('state', '=', 'validate1')]" string="Second Approval" name="second_approval"/>
<filter string="Approved" domain="[('state', '=', 'validate')]" name="validated"/>
<separator/>
<filter string="My Time Off" name="my_leaves" domain="[('employee_id.user_id', '=', uid)]"/>
<filter string="My Team" name="my_team" domain="['|', ('employee_id.leave_manager_id', '=', uid), ('employee_id.user_id', '=', uid)]" help="Time off of people you are manager of"/>
@@ -56,17 +55,14 @@
<separator/>
<filter string="Active Employee" name="active_employee" domain="[('active_employee','=',True)]"/>
<separator/>
<filter name="this_year" string="Current Year"
domain="['&amp;', ('date_from', '&gt;=', context_today().strftime('%Y-1-1')),
('date_from', '&lt;=', context_today().strftime('%Y-12-31'))]"/>
<filter name="filter_date_from" date="date_from"/>
<separator/>
<filter name="active_time_off" string="Active Time Off"
<filter name="active_time_off" string="Active"
domain="[('holiday_status_id.active', '=', True)]" help="Active Time Off"/>
<filter name="archive" string="Archived Time Off"
<filter name="archive" string="Archived"
domain="[('holiday_status_id.active', '=', False)]" help="Archived Time Off"/>
<separator/>
<filter name="archived_leaves" string="Cancelled Time Off" domain="[('active', '=', False)]" />
<filter name="archived_leaves" string="Cancelled" domain="[('active', '=', False)]" />
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>