diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 01a14f740..87c4c723b 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -58,7 +58,7 @@ class HrLeave(models.Model): column2='attachment_id' ) request_hour_from = fields.Selection([ - ('0', '12:00 上午'), ('0.5', '12:30 上午'), + ('0', '00:00 上午'), ('0.5', '00:30 上午'), ('1', '1:00 上午'), ('1.5', '1:30 上午'), ('2', '2:00 上午'), ('2.5', '2:30 上午'), ('3', '3:00 上午'), ('3.5', '3:30 上午'), @@ -83,7 +83,7 @@ class HrLeave(models.Model): ('22', '10:00 下午'), ('22.5', '10:30 下午'), ('23', '11:00 下午'), ('23.5', '11:30 下午')], string='开始时间') request_hour_to = fields.Selection([ - ('0', '12:00 上午'), ('0.5', '12:30 上午'), + ('0', '00:00 上午'), ('0.5', '00:30 上午'), ('1', '1:00 上午'), ('1.5', '1:30 上午'), ('2', '2:00 上午'), ('2.5', '2:30 上午'), ('3', '3:00 上午'), ('3.5', '3:30 上午'), @@ -156,10 +156,10 @@ class HolidaysRequestBatch(models.Model): self.leave_ids.action_validate() self.hour_leave_ids.action_validate() - @api.onchange('leave_ids', 'hour_leave_ids') + @api.onchange('is_day', 'is_hour') def _onchange_name(self): employee_name = self.users_id.name - if self.leave_ids or self.hour_leave_ids: + if self.is_day or self.is_hour: leave_types = [] for leave in self.leave_ids: if leave.number_of_days_display: diff --git a/yuthon_hr_attendance/data/attendance_time_data.xml b/yuthon_hr_attendance/data/attendance_time_data.xml index 56dec9a51..af0079a0e 100644 --- a/yuthon_hr_attendance/data/attendance_time_data.xml +++ b/yuthon_hr_attendance/data/attendance_time_data.xml @@ -200,6 +200,45 @@ -1 + + 定时任务:客服上班提醒 + + code + model.card_customer_service_shift_remind_on() + + + 1 + days + + -1 + + + + 定时任务:客服下班提醒 + + code + model.card_customer_service_shift_remind_out() + + + 1 + days + + -1 + + + + 定时任务:客服值班提醒 + + code + model.card_customer_service_stand_remind() + + + 1 + days + + -1 + + diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index d8432bc53..0d12406db 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -469,6 +469,42 @@ class HrAttendance(models.Model): 'department': user.department_id.name, }) self.card_out_comment(user.resource_id.employee_id, user.template_id.planning_name) + # 客服上班消息提醒 + def card_customer_service_shift_remind_on(self): + ba_up_users = self.env['planning.slot'].search([('role_id.name', '=', '客服中心'), ('template_id.planning_name', '=', '白班')]) + for user in ba_up_users: + if user.start_datetime.date() == fields.date.today(): + self.env['card.remind.form'].create({ + 'name': user.resource_id.employee_id.name, + 'start_time': datetime.now(), + 'shift': user.template_id.planning_name, + 'department': user.department_id.name, }) + self.card_in_comment(user.resource_id.employee_id, user.template_id.planning_name) + + # 客服下班消息提醒 + def card_customer_service_shift_remind_out(self): + ba_up_users = self.env['planning.slot'].search([('role_id.name', '=', '客服中心'), ('template_id.planning_name', '=', '白班')]) + for user in ba_up_users: + if user.start_datetime.date() == fields.date.today(): + self.env['card.remind.form'].create({ + 'name': user.resource_id.employee_id.name, + 'start_time': datetime.now(), + 'shift': user.template_id.planning_name, + 'department': user.department_id.name, }) + self.card_out_comment(user.resource_id.employee_id, user.template_id.planning_name) + + # 客服值班消息提醒 + def card_customer_service_stand_remind(self): + ba_up_users = self.env['planning.slot'].search([('role_id.name', '=', '客服中心'), ('template_id.planning_name', '=', '值班')]) + for user in ba_up_users: + if user.start_datetime.date() == fields.date.today(): + self.env['card.remind.form'].create({ + 'name': user.resource_id.employee_id.name, + 'start_time': datetime.now(), + 'shift': user.template_id.planning_name, + 'department': user.department_id.name, }) + self.card_duty_remind(user.resource_id.employee_id) + def card_in_comment(self, employee_id, planning_name): data = f"您的班次是{planning_name},还有10分钟上班,记得打卡" self.sudo().env["wecom.apps"].sync_send_message(category='att', user_id=employee_id.wecom_userid, message=data) diff --git a/yuthon_issue/views/menus.xml b/yuthon_issue/views/menus.xml index d01acb392..af4e28544 100644 --- a/yuthon_issue/views/menus.xml +++ b/yuthon_issue/views/menus.xml @@ -138,6 +138,38 @@ action="issue_library_action_cancel5" sequence="9"/> + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - + + + + + diff --git a/yuthon_property_approval/wizard/property_physical_wizard.py b/yuthon_property_approval/wizard/property_physical_wizard.py index fbfca01a1..63b13eb06 100644 --- a/yuthon_property_approval/wizard/property_physical_wizard.py +++ b/yuthon_property_approval/wizard/property_physical_wizard.py @@ -12,6 +12,7 @@ class PropertyPhysicalWizard(models.Model): excel_file = fields.Binary(string="上传Excel表") excel_name = fields.Char(string="文件名") + reimbursement_id = fields.Many2one('property.reimbursement.form', string="关联报销单") def confirm(self): """ @@ -26,4 +27,17 @@ class PropertyPhysicalWizard(models.Model): self.yuthon_physical_update(row) def yuthon_physical_update(self, row): - pass \ No newline at end of file + package_grouping = row[1].value + package_fee = row[4].value + examination_fee = row[5].value + fees = row[6].value + employee_id = self.env['hr.employee'].search([('name', '=', row[2].value)]) + physical_date = { + 'reimbursement_id':self.reimbursement_id.id, + 'package_grouping': package_grouping, + 'package_fee': package_fee, + 'examination_fee': examination_fee, + 'fees': fees, + 'employee_id': employee_id.id, + } + self.env['property.physical.line'].create(physical_date) \ No newline at end of file