summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGPA(OpenERP) <>2009-09-16 20:37:35 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2009-09-16 20:37:35 +0530
commit03a072b4b78aa348a92fdfdcfa16350aadff132b (patch)
tree7b56198118cad281930d1439679a32681f79abf5
parent5f2ab89a72fbaf4a1bec960ec137523670d0352b (diff)
[FIX] Hr_holidays : Workflow actions validations corrected
lp bug: https://launchpad.net/bugs/430098 fixed bzr revid: jvo@tinyerp.com-20090916150735-2d3cb8a1ybqt164r
-rw-r--r--addons/hr_holidays/hr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/hr_holidays/hr.py b/addons/hr_holidays/hr.py
index 5e4b1ed7a05..dc0f7a82d66 100644
--- a/addons/hr_holidays/hr.py
+++ b/addons/hr_holidays/hr.py
@@ -187,8 +187,11 @@ class hr_holidays(osv.osv):
'state':'validate',
}
ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
+
if ids2:
vals['manager_id'] = ids2[0]
+ else:
+ raise osv.except_osv(_('Warning !'),_('Either there is no Employee defined, or no User attached with it.'))
self.write(cr, uid, ids, vals)
self._create_holiday(cr, uid, ids)
return True
@@ -207,6 +210,8 @@ class hr_holidays(osv.osv):
def holidays_refuse(self, cr, uid, ids, *args):
ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
+ if not ids2:
+ raise osv.except_osv(_('Warning !'),_('Either there is no Employee defined, or no User attached with it.'))
self.write(cr, uid, ids, {
'state':'refuse',
'manager_id':ids2[0]