diff --git a/odex25_hr/attendances/models/hr_attendance_transactions.py b/odex25_hr/attendances/models/hr_attendance_transactions.py index 9c436910b..670b37264 100644 --- a/odex25_hr/attendances/models/hr_attendance_transactions.py +++ b/odex25_hr/attendances/models/hr_attendance_transactions.py @@ -1220,7 +1220,7 @@ class HrAttendanceTransactions(models.Model): one_extra_dlt = exist_trans and \ exist_trans.filtered( lambda t: t.sequence == 1 and t.attending_type == 'out_cal') or False - if one_extra_dlt and not shift_one_extra: one_extra_dlt.unlink() + if one_extra_dlt and not shift_one_extra: one_extra_dlt.sudo().unlink() one_trans.set_lateness_and_exit(one_trans) if personal_permission_module: if one_trans.temp_lateness or one_trans.temp_exit or one_breaks \ @@ -1385,14 +1385,14 @@ class HrAttendanceTransactions(models.Model): one_extra_dlt = exist_trans and \ exist_trans.filtered( lambda t: t.sequence == 1 and t.attending_type == 'out_cal') or False - if one_extra_dlt and not shift_one_extra: one_extra_dlt.unlink() + if one_extra_dlt and not shift_one_extra: one_extra_dlt.sudo().unlink() two_trans = exist_trans and \ exist_trans.filtered( lambda t: t.sequence == 2 and t.attending_type == 'in_cal') or two_trans two_extra_dlt = exist_trans and \ exist_trans.filtered( lambda t: t.sequence == 2 and t.attending_type == 'out_cal') or False - if two_extra_dlt and not shift_two_extra: two_extra_dlt.unlink() + if two_extra_dlt and not shift_two_extra: two_extra_dlt.sudo().unlink() if personal_permission_module: if one_trans.temp_lateness or one_trans.temp_exit or one_breaks \ or one_trans.sign_in == 0.0 or one_trans.sign_out == 0.0: