[MOD/IMP]hr_holidays: Usability Improvement

bzr revid: dbr@tinyerp.com-20101024052743-tua4x2ecayiwtea5
This commit is contained in:
DBR (OpenERP)
2010-10-24 10:57:43 +05:30
parent 7e54aa782c
commit 860f49ee1d
2 changed files with 8 additions and 5 deletions
@@ -29,6 +29,7 @@ class hr_holidays_report(osv.osv):
_rec_name = 'date'
_columns = {
'date': fields.date('Date', readonly=True),
'delay_approve': fields.float('Delay to Approve', digits=(16,2),readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=15, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
@@ -68,7 +69,8 @@ class hr_holidays_report(osv.osv):
to_char(s.create_date, 'YYYY-MM-DD') as day,
s.holiday_status_id,
s.department_id,
s.state
s.state,
avg(extract('epoch' from age(s.create_date,CURRENT_DATE)))/(3600*24) as delay_approve
from
hr_holidays s
WHERE type='remove'
@@ -9,6 +9,7 @@
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state in ('confirm','refuse','validate');gray:state in('cancel')" string="Leaves Statistics">
<field name="date" invisible="1"/>
<field name="delay_approve"/>
<field name="employee_id" invisible="1"/>
<field name="category_id" invisible="1"/>
<field name="user_id" invisible="1"/>
@@ -46,10 +47,10 @@
<search string="Leaves">
<group>
<filter icon="terp-go-year" string=" Year "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]" help="Leaves takes in current year"/>
<filter icon="terp-go-month" string="Month" name="month" domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]" help="Leaves takes in current month"/>
<filter icon="terp-go-week" string=" Month-1 " separator="1"
domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]" help="Leaves takes in last month"/>
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]" help="Leaves taken in current year"/>
<filter icon="terp-go-month" string=" Month " name="month" domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]" help="Leaves taken in current month"/>
<filter icon="terp-go-month" string=" Month-1 " separator="1"
domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]" help="Leaves taken in last month"/>
<separator orientation="vertical"/>
<filter string="Future Leaves" icon="terp-gtk-media-pause" domain="[('state', 'in' ,('draft','confirm'))]"
help = "Draft and Confirmed leaves"/>