diff --git a/yuthon_hr_attendance/models/yuthon_run_planning.py b/yuthon_hr_attendance/models/yuthon_run_planning.py index 6bf908b4e..127f5b65f 100644 --- a/yuthon_hr_attendance/models/yuthon_run_planning.py +++ b/yuthon_hr_attendance/models/yuthon_run_planning.py @@ -13,9 +13,8 @@ class YuthonRunPlanning(models.Model): high_run_ids = fields.One2many('yuthon.high.run.line', 'engineering_planning_id', string='关联高压班排班明细') all_run_ids = fields.One2many('yuthon.all.run.line', 'engineering_planning_id', string='关联综合部排班明细') other_run_ids = fields.One2many('yuthon.other.line', 'engineering_planning_id', string='关联其他明细') - department_run_id = fields.Many2one("hr.department", string="部门", required=True, default=lambda self: self.env['hr.department'].search([('name', '=', '运行班')])) - department_high_id = fields.Many2one("hr.department", string="部门", required=True, default=lambda self: self.env['hr.department'].search([('name', '=', '高压班')])) - department_integrated_id = fields.Many2one("hr.department", string="部门", required=True, default=lambda self: self.env['hr.department'].search([('name', '=', '综合班')])) + department_id = fields.Many2one("hr.department", string="部门", required=True) + # 运行班 def run_confirm(self): today = datetime.today().date() diff --git a/yuthon_hr_attendance/views/hr_attendance_views.xml b/yuthon_hr_attendance/views/hr_attendance_views.xml index 99821c739..7bd90b516 100644 --- a/yuthon_hr_attendance/views/hr_attendance_views.xml +++ b/yuthon_hr_attendance/views/hr_attendance_views.xml @@ -63,6 +63,12 @@ hr.attendance tree,form + + 全部考勤 + hr.attendance + tree,form + [('employee_id.resource_calendar_id.name', '=', '行政考勤')] + 我的考勤 hr.attendance diff --git a/yuthon_hr_attendance/views/yuthon_run_planning_views.xml b/yuthon_hr_attendance/views/yuthon_run_planning_views.xml index 8b900f1a7..b663e9eb8 100644 --- a/yuthon_hr_attendance/views/yuthon_run_planning_views.xml +++ b/yuthon_hr_attendance/views/yuthon_run_planning_views.xml @@ -23,7 +23,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -124,11 +124,16 @@ + + 全部 + yuthon.run.planning + tree,form + 运行班安排 yuthon.run.planning tree,form - [('department_run_id.name', '=', '运行班')] + [('department_id.name', '=', '运行班')] @@ -137,7 +142,7 @@ 综合部安排 yuthon.run.planning tree,form - [('department_high_id.name', '=', '综合班')] + [('department_id.name', '=', '综合班')] @@ -146,7 +151,7 @@ 高压部安排 yuthon.run.planning tree,form - [('department_integrated_id.name', '=', '高压班')] + [('department_id.name', '=', '高压班')] diff --git a/yuthon_hr_employee/wizard/hr_employee_time_wizard.py b/yuthon_hr_employee/wizard/hr_employee_time_wizard.py index f9f9a95ab..1e7dd33a3 100644 --- a/yuthon_hr_employee/wizard/hr_employee_time_wizard.py +++ b/yuthon_hr_employee/wizard/hr_employee_time_wizard.py @@ -32,8 +32,7 @@ class YuthonHrEmployeeTimeWizard(models.Model): def confirm(self): for employee_id in self.employee_ids: - if employee_id.resource_calendar_id: - employee_id.write({ - 'resource_calendar_id': self.attendance_id.id}) + if self.attendance_id: + employee_id.write({'resource_calendar_id': self.attendance_id.id}) else: - pass \ No newline at end of file + employee_id.write({'resource_calendar_id': False}) \ No newline at end of file diff --git a/yuthon_work_brand/views/attendance_menu.xml b/yuthon_work_brand/views/attendance_menu.xml index 435aee322..5e60f1f0e 100644 --- a/yuthon_work_brand/views/attendance_menu.xml +++ b/yuthon_work_brand/views/attendance_menu.xml @@ -79,21 +79,26 @@ name="排班安排" parent="menu_hr_attendance_engineering_record_board" sequence="1"/> + + sequence="3"/> + sequence="5"/> + sequence="7"/> -