[MERGE] do not delete confirmed payslip
bzr revid: fp@tinyerp.com-20121113075733-kidt1mqc9tf8xayh
This commit is contained in:
commit
8fe74c7900
|
@ -359,6 +359,12 @@ class hr_payslip(osv.osv):
|
|||
def check_done(self, cr, uid, ids, context=None):
|
||||
return True
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
for payslip in self.browse(cr, uid, ids, context=context):
|
||||
if payslip.state not in ['draft','cancel']:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot delete a payslip which is not draft or cancelled!'))
|
||||
return super(hr_payslip, self).unlink(cr, uid, ids, context)
|
||||
|
||||
#TODO move this function into hr_contract module, on hr.employee object
|
||||
def get_contract(self, cr, uid, employee, date_from, date_to, context=None):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue