commit
b8f07b1542
|
|
@ -100,13 +100,16 @@ class HrSalaryAdvance(models.Model):
|
|||
|
||||
def submit(self):
|
||||
for item in self:
|
||||
|
||||
if item.employee_id.state != 'open':
|
||||
raise exceptions.Warning(_('You Can Not Submit Loan where Employee %s Not In Service')
|
||||
% item.employee_id.name)
|
||||
item.create_loan()
|
||||
if item.request_type.year > (item.months_employeed / 12):
|
||||
raise exceptions.Warning(_('You can not submit loan when your total service is less than number '
|
||||
'of years'))
|
||||
deductions = item.deduction_lines
|
||||
|
||||
# if len(deductions) == 0:
|
||||
# raise exceptions.Warning(_('You must create al least one installment'))
|
||||
if len(deductions) != item.months:
|
||||
|
|
|
|||
Loading…
Reference in New Issue