[FIX] attendances: FIX bug

This commit is contained in:
younes 2025-11-23 15:26:07 +01:00
parent 28c6eb3db6
commit a71aadfb72
1 changed files with 3 additions and 3 deletions

View File

@ -1220,7 +1220,7 @@ class HrAttendanceTransactions(models.Model):
one_extra_dlt = exist_trans and \ one_extra_dlt = exist_trans and \
exist_trans.filtered( exist_trans.filtered(
lambda t: t.sequence == 1 and t.attending_type == 'out_cal') or False 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) one_trans.set_lateness_and_exit(one_trans)
if personal_permission_module: if personal_permission_module:
if one_trans.temp_lateness or one_trans.temp_exit or one_breaks \ 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 \ one_extra_dlt = exist_trans and \
exist_trans.filtered( exist_trans.filtered(
lambda t: t.sequence == 1 and t.attending_type == 'out_cal') or False 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 \ two_trans = exist_trans and \
exist_trans.filtered( exist_trans.filtered(
lambda t: t.sequence == 2 and t.attending_type == 'in_cal') or two_trans lambda t: t.sequence == 2 and t.attending_type == 'in_cal') or two_trans
two_extra_dlt = exist_trans and \ two_extra_dlt = exist_trans and \
exist_trans.filtered( exist_trans.filtered(
lambda t: t.sequence == 2 and t.attending_type == 'out_cal') or False 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 personal_permission_module:
if one_trans.temp_lateness or one_trans.temp_exit or one_breaks \ 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: or one_trans.sign_in == 0.0 or one_trans.sign_out == 0.0: