fix overtime and mission constrain

This commit is contained in:
Bakry 2025-04-22 13:50:15 +03:00
parent 328bb67cf8
commit 148ac10844
2 changed files with 3 additions and 2 deletions

View File

@ -314,7 +314,7 @@ class employee_overtime_request(models.Model):
mission = self.env['hr.official.mission.employee'].search(
[('employee_id', '=', line.employee_id.id), ('official_mission_id.state', '!=', 'refused'),
('official_mission_id.mission_type.related_with_financial', '=', True),
('official_mission_id.mission_type.work_state', '=', 'legation'),
#('official_mission_id.mission_type.work_state', '=', 'legation'),
'|', '|'] + clause_1 + clause_2 + clause_3)
if mission:
raise exceptions.Warning(_('Sorry The Employee %s Actually Has Legation '

View File

@ -1407,7 +1407,8 @@ class HrOfficialMissionEmployee(models.Model):
finacial = rec.official_mission_id.mission_type.related_with_financial
delegation = rec.official_mission_id.mission_type.work_state
if modules_req:
if delegation == 'legation' and finacial:
#if delegation == 'legation' and finacial:
if finacial == True:
if rec.date_to and rec.date_from:
clause_1 = ['&', ('employee_over_time_id.date_from', '<=', rec.date_from),
('employee_over_time_id.date_to', '>=', rec.date_from)]