diff --git a/soong_workflow/models/soong_approval_group.py b/soong_workflow/models/soong_approval_group.py index 0f8e78d82..c6ee05eab 100644 --- a/soong_workflow/models/soong_approval_group.py +++ b/soong_workflow/models/soong_approval_group.py @@ -6,5 +6,5 @@ class SoongApprovalGroup(models.Model): _name = 'soong.approval.group' _order = 'sequence' - name = fields.Char(string="分组名称") + name = fields.Char(string="分组") sequence = fields.Integer(default=1) 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_hr_attendance/models/yuthon_shift_approval.py b/yuthon_hr_attendance/models/yuthon_shift_approval.py index 12b2920bc..56803c52a 100644 --- a/yuthon_hr_attendance/models/yuthon_shift_approval.py +++ b/yuthon_hr_attendance/models/yuthon_shift_approval.py @@ -19,7 +19,7 @@ class YuthonShiftApproval(models.Model): shift_id = fields.Many2one('planning.slot', string="申请人班次1") shift_two_id = fields.Many2one('planning.slot', string="申请人班次2") return_id = fields.Many2one('planning.slot', string="调班人班次1") - return_two_id = fields.Many2one('planning.slot', string="申请人班次2") + return_two_id = fields.Many2one('planning.slot', string="调班人班次2") department_id = fields.Many2one('hr.department', string="部门", related='resource_id.employee_id.department_id') resource_ids = fields.Many2many('resource.resource', string="资源用户列表") is_issues = fields.Boolean(string='是否上会') diff --git a/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml b/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml index 2e109c35b..c713846f6 100644 --- a/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml +++ b/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml @@ -66,14 +66,14 @@ - - resource.calendar.leaves.tree - resource.calendar.leaves - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/yuthon_hr_employee/controllers/employee_banner_route.py b/yuthon_hr_employee/controllers/employee_banner_route.py index 1432770db..436ea9061 100644 --- a/yuthon_hr_employee/controllers/employee_banner_route.py +++ b/yuthon_hr_employee/controllers/employee_banner_route.py @@ -10,20 +10,20 @@ class EmployeeBannerRoute(Controller): in_hired_count = employees.search_count([]) # 在职 all_hired_count = employees.search_count([]) # 全职 return { - 'html': f""" -
-
-

正式

-

{hired_count}

-
-
-

在职

-

{in_hired_count}

-
-
-

全职

-

{all_hired_count}

-
-
- """ + # 'html': f""" + #
+ #
+ #

正式

+ #

{hired_count}

+ #
+ #
+ #

在职

+ #

{in_hired_count}

+ #
+ #
+ #

全职

+ #

{all_hired_count}

+ #
+ #
+ # """ } diff --git a/yuthon_hr_employee/models/yuthon_medical_manage.py b/yuthon_hr_employee/models/yuthon_medical_manage.py index cc0c83b34..f9b957cbe 100644 --- a/yuthon_hr_employee/models/yuthon_medical_manage.py +++ b/yuthon_hr_employee/models/yuthon_medical_manage.py @@ -2,7 +2,6 @@ from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError from datetime import datetime -import re class YuthonMedicalManage(models.Model): @@ -19,3 +18,22 @@ class YuthonMedicalManage(models.Model): prev_last_year_balance = fields.Float(string="前年结余") prev_last_year_used = fields.Float(string="前年使用") prev_last_year_remaining = fields.Float(string="前年剩余") + medical_line_ids = fields.One2many('yuthon.medical.line', 'medical_manage_id', string="体检费明细") + + def button_details(self): + form_id = self.env.ref('yuthon_hr_employee.view_yuthon_medical_manage_form').id + return { + "type": "ir.actions.act_window", + "name": "修正申请", + "res_model": "yuthon.medical.manage", + "views": [[form_id, "form"]], + "res_id": self.id, + } + +class YuthonMedicalLine(models.Model): + _name = 'yuthon.medical.line' + _description = '体检费明细' + + medical_manage_id = fields.Many2one('yuthon.medical.manage', string="关联体检费管理") + medical_date = fields.Date(string="体检日期") + medical_fee = fields.Float(string="费用") diff --git a/yuthon_hr_employee/models/yuthon_medical_rule.py b/yuthon_hr_employee/models/yuthon_medical_rule.py index 086ba3a8f..6a73bd8d2 100644 --- a/yuthon_hr_employee/models/yuthon_medical_rule.py +++ b/yuthon_hr_employee/models/yuthon_medical_rule.py @@ -11,6 +11,8 @@ class YuthonMedicalRule(models.Model): base_amount = fields.Float(string='基数金额') starting_age = fields.Integer(string='起始年龄') + department_id = fields.Many2one("hr.department", string="部门") + extension_years = fields.Selection(selection=[(str(i), str(i)) for i in range(1, 13)], string='延续年限') increase_interval_years = fields.Integer(string='递增间隔(年)') increment_amount = fields.Float(string='递增金额') cap = fields.Float(string='封顶金额') diff --git a/yuthon_hr_employee/security/ir.model.access.csv b/yuthon_hr_employee/security/ir.model.access.csv index 6640cc757..c8bc23a97 100644 --- a/yuthon_hr_employee/security/ir.model.access.csv +++ b/yuthon_hr_employee/security/ir.model.access.csv @@ -17,4 +17,5 @@ access_yuthon_hr_employee_time_wizard,yuthon_hr_employee_time_wizard,model_yutho access_hr_job_add_wizard,hr_job_add_wizard,model_hr_job_add_wizard,base.group_user,1,1,1,1 access_yuthon_party_setting,yuthon_party_setting,model_yuthon_party_setting,base.group_user,1,1,1,1 access_yuthon_medical_rule,yuthon_medical_rule,model_yuthon_medical_rule,base.group_user,1,1,1,1 -access_yuthon_medical_manage,yuthon_medical_manage,model_yuthon_medical_manage,base.group_user,1,1,1,1 \ No newline at end of file +access_yuthon_medical_manage,yuthon_medical_manage,model_yuthon_medical_manage,base.group_user,1,1,1,1 +access_yuthon_medical_line,yuthon_medical_line,model_yuthon_medical_line,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_hr_employee/views/yuthon_medical_manage_views.xml b/yuthon_hr_employee/views/yuthon_medical_manage_views.xml index fecbd88a5..1b4368689 100644 --- a/yuthon_hr_employee/views/yuthon_medical_manage_views.xml +++ b/yuthon_hr_employee/views/yuthon_medical_manage_views.xml @@ -15,9 +15,55 @@ +