@@ -84,7 +84,7 @@
yuthon.duty.arrangement
-
- 值班安排
+ 值班排班
yuthon.duty.arrangement
tree,form,calendar,search
{'search_default_current_month': 1}
diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py
index 5cf9d6a2e..b280399af 100644
--- a/yuthon_hr_attendance/models/hr_attendance.py
+++ b/yuthon_hr_attendance/models/hr_attendance.py
@@ -66,7 +66,7 @@ class HrAttendance(models.Model):
employee_ids = list(set(self.env['hr.attendance'].search([
('employee_id.department_id', 'in', department_ids)
]).mapped('employee_id').ids))
- for employee_id in employee_ids:
+ for employee_id in self.env['hr.employee'].browse(employee_ids):
planning_ids = self.env['planning.slot'].search([('resource_id', '=', employee_id.resource_id.id)])
for planning_id in planning_ids:
start_date = planning_id.start_datetime.date()
@@ -80,7 +80,7 @@ class HrAttendance(models.Model):
department_ids = self.env['hr.department'].search([('name', 'in',['工程部', '运行班', '高压班','综合班'])]).ids
employee_ids = list(set(self.env['hr.attendance'].search([('employee_id.department_id', 'in', department_ids)
]).mapped('employee_id').ids))
- for employee_id in employee_ids:
+ for employee_id in self.env['hr.employee'].browse(employee_ids):
planning_ids = self.env['planning.slot'].search([('resource_id', '=', employee_id.resource_id.id)])
for planning_id in planning_ids:
start_date = planning_id.start_datetime.date()
diff --git a/yuthon_hr_attendance/models/yuthon_run_planning.py b/yuthon_hr_attendance/models/yuthon_run_planning.py
index fdfcf04b1..2656997a4 100644
--- a/yuthon_hr_attendance/models/yuthon_run_planning.py
+++ b/yuthon_hr_attendance/models/yuthon_run_planning.py
@@ -76,7 +76,7 @@ class YuthonRunPlanning(models.Model):
other_resource_id = other.employee_id.resource_id
regular_holiday = other.regular_holidays
weekday_mapping = {
- 'one': 6, 'two': 0, 'three': 1, 'four': 2, 'five': 3, 'six': 4, 'seven': 5
+ 'one': 7, 'two': 1, 'three': 2, 'four': 3, 'five': 4, 'six': 5, 'seven': 6
}
weekday_number = weekday_mapping.get(regular_holiday)
other_data[other_resource_id.id] = weekday_number
@@ -88,8 +88,8 @@ class YuthonRunPlanning(models.Model):
self.env['planning.slot'].create({
'template_id': self.env['planning.slot.template'].search([('role_id', '=', role_a.id), ('planning_name', '=', '白班')]).id,
'resource_id': resource_id.id,
- 'start_datetime': datetime(current_date.year, current_date.month, current_date.day,start_time) + timedelta(hours=16),
- 'end_datetime': datetime(current_date.year, current_date.month, current_date.day,end_time) + timedelta(hours=16),
+ 'start_datetime': datetime(current_date.year, current_date.month, current_date.day,start_time) + timedelta(hours=16)- timedelta(days=1),
+ 'end_datetime': datetime(current_date.year, current_date.month, current_date.day,end_time) + timedelta(hours=16)- timedelta(days=1),
'role_id': role_a.id,
'allocated_hours': 8,
})
diff --git a/yuthon_hr_attendance/views/yuthon_run_planning_views.xml b/yuthon_hr_attendance/views/yuthon_run_planning_views.xml
index b663e9eb8..26ca2ed1e 100644
--- a/yuthon_hr_attendance/views/yuthon_run_planning_views.xml
+++ b/yuthon_hr_attendance/views/yuthon_run_planning_views.xml
@@ -25,7 +25,7 @@
-
+
@@ -73,7 +73,7 @@
-
+
@@ -111,7 +111,7 @@
-
+
@@ -130,7 +130,7 @@
tree,form
- 运行班安排
+ 运行班排班
yuthon.run.planning
tree,form
[('department_id.name', '=', '运行班')]
@@ -139,7 +139,7 @@
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_hr_attendance.view_yuthon_run_planning_form')})]"/>
- 综合部安排
+ 综合部排班
yuthon.run.planning
tree,form
[('department_id.name', '=', '综合班')]
@@ -148,7 +148,7 @@
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_hr_attendance.view_yuthon_integrated_planning_form')})]"/>
- 高压部安排
+ 高压部排班
yuthon.run.planning
tree,form
[('department_id.name', '=', '高压班')]
diff --git a/yuthon_work_brand/views/attendance_menu.xml b/yuthon_work_brand/views/attendance_menu.xml
index 7c0b0a3c5..01e4fb404 100644
--- a/yuthon_work_brand/views/attendance_menu.xml
+++ b/yuthon_work_brand/views/attendance_menu.xml
@@ -175,15 +175,15 @@
name="粮库值班管理"
parent="hr_attendance_root_board"
sequence="9"/>
-
+