commit
d09d2b22e1
|
|
@ -539,9 +539,13 @@ class HrAttendanceTransactions(models.Model):
|
|||
mission_df = self.convert_float_2time(emp_mission.hour_from, emp_mission.date_from)
|
||||
mission_dt = self.convert_float_2time(emp_mission.hour_to, emp_mission.date_from)
|
||||
if trans.sign_in == 0.0 or trans.sign_out == 0.0:
|
||||
## chick plan hours and mision hours
|
||||
mission_hours = mission.hour_duration
|
||||
if trans.plan_hours < mission.hour_duration:
|
||||
mission_hours = trans.plan_hours
|
||||
miss_dic = {'is_official': True,
|
||||
'official_id': mission.id,
|
||||
'total_mission_hours': mission.hour_duration,
|
||||
'total_mission_hours': mission_hours #mission.hour_duration,
|
||||
}
|
||||
if state != 'check': trans.update(miss_dic)
|
||||
if state is not None:
|
||||
|
|
|
|||
|
|
@ -220,6 +220,12 @@ class EmployeeOtherRequest(models.Model):
|
|||
hijri_date = convert.Gregorian(year, month, day).to_hijri()
|
||||
return hijri_date
|
||||
|
||||
def unlink(self):
|
||||
for rec in self:
|
||||
if rec.state != 'draft':
|
||||
raise exceptions.Warning(_('You can not delete record in state not in draft'))
|
||||
return super(EmployeeOtherRequest, self).unlink()
|
||||
|
||||
|
||||
class salaryDestination(models.Model):
|
||||
_name = 'salary.destination'
|
||||
|
|
|
|||
Loading…
Reference in New Issue