[FIX]: fix validation problem

bzr revid: atp@tinyerp.com-20121107061152-ch2ti57eezbw2xo8
This commit is contained in:
Atul Patel (OpenERP) 2012-11-07 11:41:52 +05:30
parent cda1256ae8
commit 58f5269f11
1 changed files with 2 additions and 1 deletions

View File

@ -269,7 +269,8 @@ class hr_holidays(osv.osv):
def write(self, cr, uid, ids, vals, context=None):
res = super(hr_holidays, self).write(cr, uid, ids, vals, context=context)
for holiday in self.browse(cr, uid, ids, context=context):
if holiday.state == 'validate' and holiday.employee_id.user_id.id != 1:
if holiday.state == 'validate' and holiday.employee_id.user_id.id == uid and uid != 1:
raise osv.except_osv(_('Warning!'),_('You cannot modify leave request, Once the leave Request has been approved'))
return res