[FIX] hr_holidays: multiple fixes for search filters

- Wrong 'year' filter that implemented in fact an 'active types' filter
- Add a real 'year' filter
- 'my leaves' uses directly the 'user_id' related field
- 'My Department Leaves' filter that mixed ids from different models

Closes #7685
This commit is contained in:
Olivier LAURENT 2015-07-20 11:47:29 +02:00 committed by Nicolas Martinelli
parent f2108e9edd
commit 755b09c8dc
2 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,4 @@
<?xml version='1.0' encoding='UTF-8' ?>
<openerp>
<data>
@ -26,11 +27,18 @@
<filter domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
<filter domain="[('state','=','validate')]" string="Validated" name="validated"/>
<separator/>
<filter name="year" string="Year" domain="[('holiday_status_id.active','=',True)]" help="Filters only on allocations and requests that belong to an holiday type that is 'active' (active field is True)"/>
<filter name="active_types" string="Active Types" domain="[('holiday_status_id.active', '=', True)]" help="Filters only on allocations and requests that belong to an holiday type that is 'active' (active field is True)"/>
<separator/>
<filter string="My Requests" name="my_leaves" domain="[('employee_id.user_id','=', uid)]" help="My Leave Requests"/>
<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'))]"
help="Current Year Leaves"/>
<separator/>
<filter string="My Department Leaves" help="My Department Leaves" domain="[('department_id.manager_id','=',uid)]"/>
<filter string="My Requests" name="my_leaves" domain="[('user_id', '=', uid)]" help="My Leave Requests"/>
<separator/>
<filter string="My Department Leaves" name="my_department_leaves" domain="[('department_id.manager_id.user_id', '=', uid)]"/>
<field name="employee_id"/>
<field name="department_id"/>
<field name="holiday_status_id"/>

View File

@ -42,6 +42,11 @@ msgstr ""
msgid "Active"
msgstr ""
#. module: hr_holidays
#: view:hr.holidays:hr_holidays.view_hr_holidays_filter
msgid "Active Types"
msgstr ""
#. module: hr_holidays
#: view:hr.holidays:hr_holidays.allocation_company_new
#: view:hr.holidays:hr_holidays.edit_holiday_new
@ -249,6 +254,11 @@ msgstr ""
msgid "Current Leave Type"
msgstr ""
#. module: hr_holidays
#: view:hr.holidays:hr_holidays.view_hr_holidays_filter
msgid "Current Year Leaves"
msgstr ""
#. module: hr_holidays
#: help:hr.holidays,message_last_post:0
msgid "Date of the last message posted on the record."