[IMP] hr_holidays: removed condition checked for context and context passed in xml

bzr revid: mtr@mtr-20110705091525-hm0772szzv6xa3zc
This commit is contained in:
mtr
2011-07-05 14:45:25 +05:30
parent d93d0aa0fa
commit 9784142fe7
2 changed files with 6 additions and 16 deletions
-10
View File
@@ -190,8 +190,6 @@ class hr_holidays(osv.osv):
def onchange_date_from(self, cr, uid, ids, date_to, date_from, context=None):
result = {}
if context is None:
context = {}
if date_to and date_from:
diff_day = self._get_number_of_days(date_from, date_to, context=context)
result['value'] = {
@@ -226,8 +224,6 @@ class hr_holidays(osv.osv):
return True
def holidays_validate(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.check_holidays(cr, uid, ids, context=context)
obj_emp = self.pool.get('hr.employee')
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
@@ -235,8 +231,6 @@ class hr_holidays(osv.osv):
return self.write(cr, uid, ids, {'state':'validate1', 'manager_id': manager})
def holidays_validate2(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.check_holidays(cr, uid, ids, context=context)
obj_emp = self.pool.get('hr.employee')
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
@@ -283,14 +277,10 @@ class hr_holidays(osv.osv):
return True
def holidays_confirm(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.check_holidays(cr, uid, ids, context=context)
return self.write(cr, uid, ids, {'state':'confirm'})
def holidays_refuse(self, cr, uid, ids, context=None):
if context is None:
context = {}
obj_emp = self.pool.get('hr.employee')
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
manager = ids2 and ids2[0] or False
+6 -6
View File
@@ -71,7 +71,7 @@
<form string="Leave Request">
<group col="8" colspan="4">
<field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}" />
<field name="holiday_type" on_change="onchange_type(holiday_type, context)" attrs="{'readonly':[('state','!=','draft')]}" width="130" groups="base.group_hr_manager"/>
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" groups="base.group_hr_manager"/>
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
</group>
@@ -83,8 +83,8 @@
<page string="General">
<field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}" />
<field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" />
<field name="date_from" on_change="onchange_date_from(date_to, date_from, context)" required="1"/>
<field name="date_to" on_change="onchange_date_from(date_to, date_from, context)" required="1"/>
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1"/>
<field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1"/>
<field name="number_of_days_temp"/>
<newline/>
<field name="manager_id"/>
@@ -115,7 +115,7 @@
<form string="Allocation Request">
<group col="8" colspan="4">
<field name="name" />
<field name="holiday_type" on_change="onchange_type(holiday_type, context)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Category" groups="base.group_hr_manager"/>
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Category" groups="base.group_hr_manager"/>
<group attrs="{'invisible':[('holiday_type','=','category')]}">
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}"/>
</group>
@@ -181,8 +181,8 @@
<field name="name" />
<field name="holiday_status_id" />
<field name="type"/>
<field name="date_from" on_change="onchange_date_from(date_to, date_from, context)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
<field name="date_to" on_change="onchange_date_from(date_to, date_from, context)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
<field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
<field name="number_of_days_temp"/>
<notebook colspan="4">
<page string="General">