[IMP] raise warning if there isn't any contract selected on employee leave request
bzr revid: psi@tinyerp.co.in-20110331122829-20k622n739xad2xi
This commit is contained in:
@@ -811,7 +811,7 @@ class hr_payslip(osv.osv):
|
||||
value = line.amount
|
||||
else:
|
||||
value = line.amount
|
||||
|
||||
|
||||
elif line.amount_type == 'code':
|
||||
localdict = {'basic': amt, 'employee': slip.employee_id, 'contract': contract}
|
||||
exec line.python_compute in localdict
|
||||
@@ -828,7 +828,7 @@ class hr_payslip(osv.osv):
|
||||
value = val
|
||||
else:
|
||||
value = val
|
||||
|
||||
|
||||
total += value
|
||||
vals = {
|
||||
'slip_id': slip.id,
|
||||
@@ -1349,6 +1349,13 @@ class hr_holidays(osv.osv):
|
||||
})
|
||||
return {'value': res}
|
||||
|
||||
def holidays_confirm(self, cr, uid, ids, *args):
|
||||
leaves = self.browse(cr, uid, ids)
|
||||
for leave in leaves:
|
||||
if not leave.contract_id:
|
||||
raise osv.except_osv(_('Warning !'), _("Please define contract on %s's leave request ! ") % (leave.employee_id.name))
|
||||
return super(hr_holidays, self).holidays_confirm(cr, uid, ids)
|
||||
|
||||
hr_holidays()
|
||||
|
||||
class hr_payslip_line(osv.osv):
|
||||
|
||||
Reference in New Issue
Block a user