From 9784142fe7bc141f9695dbf0d6d4ed7d18c08a67 Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 5 Jul 2011 14:45:25 +0530 Subject: [PATCH] [IMP] hr_holidays: removed condition checked for context and context passed in xml bzr revid: mtr@mtr-20110705091525-hm0772szzv6xa3zc --- addons/hr_holidays/hr_holidays.py | 10 ---------- addons/hr_holidays/hr_holidays_view.xml | 12 ++++++------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index e2cf2a5bace..2fcd594bee0 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -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 diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 45f8aa8c3f5..608fda554fb 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -71,7 +71,7 @@
- + @@ -83,8 +83,8 @@ - - + + @@ -115,7 +115,7 @@ - + @@ -181,8 +181,8 @@ - - + +