[FIX] hr_holidays: In leaves analysis report filter buttons Year|Month|Month-1 added

lp bug: https://launchpad.net/bugs/908798 fixed

bzr revid: jap@tinyerp.com-20111229104219-fbzgrcxpv9jxyqzp
This commit is contained in:
Jagdish Panchal (Open ERP) 2011-12-29 16:12:19 +05:30
parent d3866325f3
commit d2d20a1d4c
2 changed files with 8 additions and 5 deletions

View File

@ -8,14 +8,17 @@
<field name="arch" type="xml">
<search string="Search Leave">
<group>
<filter icon="terp-go-year" name="year" string="Year" domain="[('date_from','&gt;=',time.strftime('%%Y-1-1')),('date_from','&lt;=',time.strftime('%%Y-12-31'))]"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-go-month" name="This Month" domain="[('date_from','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"/>
<filter icon="terp-go-month" string=" Month-1 "
domain="[('date_from','&lt;=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('date_from','&gt;=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
help="Holidays during last month"/>
<separator orientation="vertical"/>
<filter icon="terp-check" domain="[('state','=','draft')]" string="To Confirm"/>
<filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve" name="approve"/>
<filter icon="terp-camera_test" domain="[('state','=','validate')]" string="Validated" name="validated"/>
<separator orientation="vertical"/>
<filter icon="terp-go-year" name="year" string="Year" domain="[('create_date','&gt;=',time.strftime('%%Y-1-1')),('create_date','&lt;=',time.strftime('%%Y-12-31'))]"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-go-month" name="This Month" domain="[('date_from','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"/>
<separator orientation="vertical"/>
<field name="employee_id">
<filter icon="terp-personal" name="my_leaves" domain="[('employee_id.user_id','=', uid)]" help="My Leaves"/>
</field>

View File

@ -8,7 +8,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="view_holiday_simple"/>
<field name="context">{'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
<field name="context">{'search_default_year':1, 'search_default_This Month':1, 'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
<field name="domain">[('holiday_type','=','employee')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>