[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:
Thibault Delavallée
2015-11-17 14:45:50 +01:00
parent 32edde6bcf
commit 6543554b95
+5 -4
View File
@@ -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="['|','&amp;',('date_to', '&lt;=', time.strftime('%%Y-12-31')),
('date_to', '&gt;=', time.strftime('%%Y-01-01')),
'&amp;',('date_from', '&lt;=', time.strftime('%%Y-12-31')),
('date_from', '&gt;=', time.strftime('%%Y-01-01'))]"
domain="['|',
'&amp;', '&amp;', ('date_to', '=', False), ('date_from', '=', False), ('holiday_status_id.active', '=', True),
'|',
'&amp;',('date_to', '&lt;=', time.strftime('%%Y-12-31')), ('date_to', '&gt;=', time.strftime('%%Y-01-01')),
'&amp;',('date_from', '&lt;=', time.strftime('%%Y-12-31')), ('date_from', '&gt;=', time.strftime('%%Y-01-01'))]"
help="Current Year Leaves"/>
<separator/>
<filter string="My Requests" name="my_leaves" domain="[('user_id', '=', uid)]"/>