[FIX] hr_holidays: Year filter
This filter filters requests for this year. However allocation requests do not have date_from and date_to. For requests not having those dates the filter takes requests whose type (holiday_status_id) is active. This was the old Year filter, that is applied only to allocation requests now. Leave request are still based on date_from and date_to.
This commit is contained in:
@@ -38,10 +38,11 @@
|
||||
<filter string="To Do" name="todo" domain="[('payslip_status', '=', False), ('holiday_status_id.active', '=', True)]"/>
|
||||
<separator/>
|
||||
<filter name="year" string="Year"
|
||||
domain="['|','&',('date_to', '<=', time.strftime('%%Y-12-31')),
|
||||
('date_to', '>=', time.strftime('%%Y-01-01')),
|
||||
'&',('date_from', '<=', time.strftime('%%Y-12-31')),
|
||||
('date_from', '>=', time.strftime('%%Y-01-01'))]"
|
||||
domain="['|',
|
||||
'&', '&', ('date_to', '=', False), ('date_from', '=', False), ('holiday_status_id.active', '=', True),
|
||||
'|',
|
||||
'&',('date_to', '<=', time.strftime('%%Y-12-31')), ('date_to', '>=', time.strftime('%%Y-01-01')),
|
||||
'&',('date_from', '<=', time.strftime('%%Y-12-31')), ('date_from', '>=', time.strftime('%%Y-01-01'))]"
|
||||
help="Current Year Leaves"/>
|
||||
<separator/>
|
||||
<filter string="My Requests" name="my_leaves" domain="[('user_id', '=', uid)]"/>
|
||||
|
||||
Reference in New Issue
Block a user