From 5c2714371158b752c8a8d93de7cffd02cb259f6f Mon Sep 17 00:00:00 2001
From: blackbelts <74664702+eslamtalaat74@users.noreply.github.com>
Date: Tue, 8 Jul 2025 10:24:21 +0300
Subject: [PATCH 1/5] fix get_speacial_day_timing error
---
.../models/hr_attendance_transactions.py | 24 ++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/odex25_hr/attendances/models/hr_attendance_transactions.py b/odex25_hr/attendances/models/hr_attendance_transactions.py
index fde56b8ef..973674de1 100644
--- a/odex25_hr/attendances/models/hr_attendance_transactions.py
+++ b/odex25_hr/attendances/models/hr_attendance_transactions.py
@@ -412,16 +412,34 @@ class HrAttendanceTransactions(models.Model):
time_list[7] = two_sp_timing and two_sp_timing.end_sign_out or calendar.shift_two_max_sign_out
return time_list, planed_hours
+ # def get_speacial_day_timing(self, calender, weekday, at_date, shift=None):
+ # sp_days = shift and calender.special_days_partcial or calender.special_days
+ # for spday in sp_days:
+ # if spday.name.lower() == weekday and ((shift and spday.shift == shift) or (not shift and True)):
+ # if spday.date_from and spday.date_to \
+ # and str(at_date) >= spday.date_from and str(at_date) <= spday.date_to:
+ # return spday
+ # elif spday.date_from and not spday.date_to and str(at_date) >= spday.date_from:
+ # return spday
+ # elif not spday.date_from and spday.date_to and str(at_date) <= spday.date_to:
+ # return spday
+ # elif not spday.date_from and not spday.date_to:
+ # return spday
+
def get_speacial_day_timing(self, calender, weekday, at_date, shift=None):
+ # Ensure at_date is a date object
+ if isinstance(at_date, str):
+ # Adjust the format string to match your date string format
+ at_date = datetime.strptime(at_date, "%Y-%m-%d").date()
sp_days = shift and calender.special_days_partcial or calender.special_days
for spday in sp_days:
if spday.name.lower() == weekday and ((shift and spday.shift == shift) or (not shift and True)):
if spday.date_from and spday.date_to \
- and str(at_date) >= spday.date_from and str(at_date) <= spday.date_to:
+ and at_date >= spday.date_from and at_date <= spday.date_to:
return spday
- elif spday.date_from and not spday.date_to and str(at_date) >= spday.date_from:
+ elif spday.date_from and not spday.date_to and at_date >= spday.date_from:
return spday
- elif not spday.date_from and spday.date_to and str(at_date) <= spday.date_to:
+ elif not spday.date_from and spday.date_to and at_date <= spday.date_to:
return spday
elif not spday.date_from and not spday.date_to:
return spday
From 41f7be68bd4ae885ab620d27cb10f8ea809783f3 Mon Sep 17 00:00:00 2001
From: blackbelts <74664702+eslamtalaat74@users.noreply.github.com>
Date: Tue, 8 Jul 2025 10:41:03 +0300
Subject: [PATCH 2/5] modify on contract view
---
.../hr_contract_custom/views/contract_view.xml | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/odex25_hr/hr_contract_custom/views/contract_view.xml b/odex25_hr/hr_contract_custom/views/contract_view.xml
index 154899858..09ce31565 100644
--- a/odex25_hr/hr_contract_custom/views/contract_view.xml
+++ b/odex25_hr/hr_contract_custom/views/contract_view.xml
@@ -11,9 +11,12 @@
-
+ states="employeed_aproval" groups="hr.group_hr_manager"/>
+
+
+
+
+
+ statusbar_visible="draft,employeed_aproval,program_directory,end_contract"/>
+
+
+
@@ -288,6 +294,7 @@
>
+
From 39fe6f67f6f84ecc517ee8d078daea85200fbb4c Mon Sep 17 00:00:00 2001
From: mohammed-alkhazrji
Date: Tue, 8 Jul 2025 20:31:24 +0300
Subject: [PATCH 3/5] calc right missing
---
odex25_hr/attendances/models/hr_attendance_report.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/odex25_hr/attendances/models/hr_attendance_report.py b/odex25_hr/attendances/models/hr_attendance_report.py
index 2ee23461c..31c55774e 100644
--- a/odex25_hr/attendances/models/hr_attendance_report.py
+++ b/odex25_hr/attendances/models/hr_attendance_report.py
@@ -246,15 +246,15 @@ class HrAttendanceReport(models.Model):
'absent': actual_absent_hours + missing_punch_hours + break_hours + early_exit_hours + lateness_hours ,
'mission_by_days': total_mission,
'absent_days_by_hr': 0.0,
- 'total_hours': missed_hours,
+ 'total_hours': missed_hours + missing_punch_hours,
'dummy_field': missed_hours,
'actual_absent_hours': actual_absent_hours,
'total_permission_hours':total_permission_hours,
'missing_punch_hours':missing_punch_hours ,
'total_amount': employee.contract_id.total_allowance,
'amount_per_hour': employee.contract_id.total_allowance / working_hours_flexible_days,
- 'total_deduction': missed_hours * (
- employee.contract_id.total_allowance / working_hours_flexible_days)
+ 'total_deduction': (missed_hours * (
+ employee.contract_id.total_allowance / working_hours_flexible_days)) + missing_punch_hours
}
item_list.append(values)
elif not emp_calendar.is_flexible:
@@ -345,11 +345,11 @@ class HrAttendanceReport(models.Model):
'absent': actual_absent_hours + missing_punch_hours + lateness + early_exist + extra_break_duration,
'mission_by_days': total_mission_by_day,
'absent_days_by_hr': lateness_hours_by_hr,
- 'total_hours': get_total_hours,
+ 'total_hours': get_total_hours + missing_punch_hours,
'dummy_field': get_total_hours,
'total_amount': get_total_amount,
'amount_per_hour': get_amount_per_hour,
- 'total_deduction': get_total_hours * get_amount_per_hour,
+ 'total_deduction': (get_total_hours * get_amount_per_hour)+missing_punch_hours,
'additional_hours': additional_hours,
'actual_absent_hours':actual_absent_hours,
'total_permission_hours':total_permission_hours,
From 9c81cefb26804936b010f4d7f95fb9bedd14f60b Mon Sep 17 00:00:00 2001
From: mohammed-alkhazrji
Date: Tue, 8 Jul 2025 20:35:23 +0300
Subject: [PATCH 4/5] calc right missing
---
odex25_hr/attendances/models/hr_attendance_report.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/odex25_hr/attendances/models/hr_attendance_report.py b/odex25_hr/attendances/models/hr_attendance_report.py
index 31c55774e..36a608298 100644
--- a/odex25_hr/attendances/models/hr_attendance_report.py
+++ b/odex25_hr/attendances/models/hr_attendance_report.py
@@ -253,8 +253,8 @@ class HrAttendanceReport(models.Model):
'missing_punch_hours':missing_punch_hours ,
'total_amount': employee.contract_id.total_allowance,
'amount_per_hour': employee.contract_id.total_allowance / working_hours_flexible_days,
- 'total_deduction': (missed_hours * (
- employee.contract_id.total_allowance / working_hours_flexible_days)) + missing_punch_hours
+ 'total_deduction': ((missed_hours+ missing_punch_hours) * (
+ employee.contract_id.total_allowance / working_hours_flexible_days))
}
item_list.append(values)
elif not emp_calendar.is_flexible:
@@ -349,7 +349,7 @@ class HrAttendanceReport(models.Model):
'dummy_field': get_total_hours,
'total_amount': get_total_amount,
'amount_per_hour': get_amount_per_hour,
- 'total_deduction': (get_total_hours * get_amount_per_hour)+missing_punch_hours,
+ 'total_deduction': (get_total_hours + missing_punch_hours)* get_amount_per_hour,
'additional_hours': additional_hours,
'actual_absent_hours':actual_absent_hours,
'total_permission_hours':total_permission_hours,
From 1448ecbba44fbf9cb8c5b8a9d70ff8265611623a Mon Sep 17 00:00:00 2001
From: blackbelts <74664702+eslamtalaat74@users.noreply.github.com>
Date: Wed, 9 Jul 2025 10:50:45 +0300
Subject: [PATCH 5/5] change groups sequrity on loan
---
.../hr_base_reports/wizard/employee_cost_wizard.xml | 6 ++++--
.../security/hr_loans_salary_advance.xml | 9 ++++++---
.../views/hr_loan_salary_advance.xml | 6 +++++-
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/odex25_hr/hr_base_reports/wizard/employee_cost_wizard.xml b/odex25_hr/hr_base_reports/wizard/employee_cost_wizard.xml
index e85f12cb5..97e543e10 100644
--- a/odex25_hr/hr_base_reports/wizard/employee_cost_wizard.xml
+++ b/odex25_hr/hr_base_reports/wizard/employee_cost_wizard.xml
@@ -1,6 +1,6 @@
-
+
employee.cost.report.form
@@ -60,7 +60,7 @@
id="employee_request_root_report_menu"
name="Reports"
parent="employee_requests.employee_request_menu_item"
- groups="hr.group_hr_user"/>
+ groups="hr.group_hr_user"/>
Overtime /Month
@@ -205,6 +205,8 @@
diff --git a/odex25_hr/hr_loans_salary_advance/security/hr_loans_salary_advance.xml b/odex25_hr/hr_loans_salary_advance/security/hr_loans_salary_advance.xml
index c3fa1743c..c4cb292cf 100644
--- a/odex25_hr/hr_loans_salary_advance/security/hr_loans_salary_advance.xml
+++ b/odex25_hr/hr_loans_salary_advance/security/hr_loans_salary_advance.xml
@@ -48,7 +48,7 @@
[(1 ,'=', 1)]
@@ -78,11 +78,14 @@
[(1 ,'=', 1)]
+
+
Employee loan payment suspension multi-company rule
diff --git a/odex25_hr/hr_loans_salary_advance/views/hr_loan_salary_advance.xml b/odex25_hr/hr_loans_salary_advance/views/hr_loan_salary_advance.xml
index d0427fd9d..06070ae25 100644
--- a/odex25_hr/hr_loans_salary_advance/views/hr_loan_salary_advance.xml
+++ b/odex25_hr/hr_loans_salary_advance/views/hr_loan_salary_advance.xml
@@ -191,8 +191,12 @@
-