[IMP] hr: Add category field on employee form view
[FIX] hr_holidays: fix some errors bzr revid: mra@tinyerp.com-20100518062616-wgvs7cv6gq14n9ee
This commit is contained in:
parent
11c75c9586
commit
f065d01dfc
|
@ -50,9 +50,10 @@
|
||||||
<separator string="Position" colspan="2"/>
|
<separator string="Position" colspan="2"/>
|
||||||
<field name="job_id" widget="selection"/>
|
<field name="job_id" widget="selection"/>
|
||||||
<field name="department_id" widget="selection"/>
|
<field name="department_id" widget="selection"/>
|
||||||
|
<field name="category_id" />
|
||||||
<separator string="Managers" colspan="2"/>
|
<separator string="Managers" colspan="2"/>
|
||||||
<field name="parent_id" select="1"/>
|
<field name="parent_id" />
|
||||||
<field name="coach_id" select="1"/>
|
<field name="coach_id" />
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<group col="2" colspan="2">
|
<group col="2" colspan="2">
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import time
|
import time
|
||||||
|
import datetime
|
||||||
|
|
||||||
import pooler
|
import pooler
|
||||||
import netsvc
|
import netsvc
|
||||||
|
@ -182,14 +183,14 @@ class hr_holidays(osv.osv):
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _get_number_of_days(date_from, date_to):
|
def _get_number_of_days(self, date_from, date_to):
|
||||||
"""Returns a float equals to the timedelta between two dates given as string."""
|
"""Returns a float equals to the timedelta between two dates given as string."""
|
||||||
|
|
||||||
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
|
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
|
||||||
from_dt = datetime.datetime.strptime(date_from, DATETIME_FORMAT)
|
from_dt = datetime.datetime.strptime(date_from, DATETIME_FORMAT)
|
||||||
to_dt = datetime.datetime.strptime(date_to, DATETIME_FORMAT)
|
to_dt = datetime.datetime.strptime(date_to, DATETIME_FORMAT)
|
||||||
timedelta = to_dt - from_dt
|
timedelta = to_dt - from_dt
|
||||||
diff_day = timedelta.days + float(timedelata.seconds) / 86400
|
diff_day = timedelta.days + float(timedelta.seconds) / 86400
|
||||||
return diff_day
|
return diff_day
|
||||||
|
|
||||||
def _update_user_holidays(self, cr, uid, ids):
|
def _update_user_holidays(self, cr, uid, ids):
|
||||||
|
@ -235,7 +236,7 @@ class hr_holidays(osv.osv):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def onchange_date_to(self, cr, uid, ids, date_from, date_to):
|
def onchange_date_to(self, cr, uid, ids, date_from, date_to):
|
||||||
return onchange_date_from(cr, uid, ids, date_to, date_from)
|
return self.onchange_date_from(cr, uid, ids, date_to, date_from)
|
||||||
|
|
||||||
def onchange_sec_id(self, cr, uid, ids, status, context={}):
|
def onchange_sec_id(self, cr, uid, ids, status, context={}):
|
||||||
warning = {}
|
warning = {}
|
||||||
|
|
Loading…
Reference in New Issue