diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index f914faecc..f6158f3ed 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -337,7 +337,7 @@ class AppletAttendance(Controller): """ _logger.info("-------触发打卡接口/yuthon/att/record---------") res_user_id = request.env(user=SUPERUSER_ID)["res.users"].search([('id', '=', kw.get('user_id'))]) - _logger.info(f"传过来的user_id:{kw.get('user_id')},名称{res_user_id.name}") + _logger.info(f"传过来的user_id:{kw.get('user_id')},名称{res_user_id.name}, 时间{fields.Datetime.now()}") employee_id = request.env(user=SUPERUSER_ID)["hr.employee"].search([('name', '=', res_user_id.name)]) if res_user_id and employee_id: # 初始化变量 diff --git a/yuthon_hr_attendance/models/resource_calendar_leaves.py b/yuthon_hr_attendance/models/resource_calendar_leaves.py index 4736ad182..dcca6b30a 100644 --- a/yuthon_hr_attendance/models/resource_calendar_leaves.py +++ b/yuthon_hr_attendance/models/resource_calendar_leaves.py @@ -27,10 +27,10 @@ class ResourceCalendar(models.Model): active_id = fields.Boolean('Active', default=True, tracking=True) resource_user_ids = fields.Many2many('hr.employee', 'resource_employee_rel', 'custom_id', 'employee_id', store=True, index=True, string="白名单") - resource_user_ids2 = fields.Many2many('hr.employee', 'resource_employee_rel2', 'custom_id', 'employee_id', - store=True, index=True, string="哺乳期人员") - + # resource_user_ids2 = fields.Many2many('hr.employee', 'resource_employee_rel2', 'custom_id', 'employee_id', + # store=True, index=True, string="哺乳期人员") + breastfeeding_holiday_ids = fields.One2many('breastfeeding.holiday', 'resource_calendar_id', string='哺乳假明细') def get_baidu_holiday(self): """ 通过百度日历接口获取法定节假日信息 @@ -111,6 +111,15 @@ class ResourceCalendar(models.Model): self.write({'calendar_holiday_ids': holiday_list, 'global_leave_ids': leave_list}) +class BreastfeedingHolidaye(models.Model): + _name = "breastfeeding.holiday" + + resource_calendar_id = fields.Many2one('resource.calendar') + employee_id = fields.Many2one('hr.employee', string="员工") + breastfeeding_type = fields.Selection([('1', '上午'), ('2', '下午')], string="类型") + calendar_start_time = fields.Datetime(string="假期开始时间") + calendar_end_time = fields.Datetime(string="假期结束时间") + class ResourceCalendarHolidaye(models.Model): _name = "resource.calendar.holiday" diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 4bc58f012..fdfb97102 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -64,6 +64,8 @@ class YuthonVacationReports(models.Model): is_abnormal = fields.Integer(string="异常", compute='compute_attendance_fields', store=True, group_operator=None) att_mount = fields.Integer(string="出勤天数", compute='compute_attendance_fields', store=True, group_operator=None) + attendance_message_log_ids = fields.One2many('attendance.message.log', 'vacation_id') + vacation_state = fields.Selection( selection=[ @@ -911,6 +913,17 @@ class VacationOtherLine(models.Model): 'view_mode': 'form', } +class AttendanceMessageLog(models.Model): + _name = 'attendance.message.log' + _description = '消息提醒日志' + + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期额度记录') + employee_id = fields.Many2one('hr.employee', string='员工') + update_date = fields.Datetime(string='更新时间') + message_type = fields.Selection([('1', '上班'), ('2', '下班'), ('3', '异常'), ('4', '考勤确认'), ('5', '薪资')], string="类型") + message_url = fields.Char(string="url") + + class DetailsTree(models.Model): _name = 'details.tree' diff --git a/yuthon_hr_attendance/security/ir.model.access.csv b/yuthon_hr_attendance/security/ir.model.access.csv index b8886c805..dfebb624c 100644 --- a/yuthon_hr_attendance/security/ir.model.access.csv +++ b/yuthon_hr_attendance/security/ir.model.access.csv @@ -16,6 +16,9 @@ access_details_tree, details_tree,model_details_tree,base.group_user,1,1,1,1 access_vacation_medical_line,vacation_medical_line,model_vacation_medical_line,base.group_user,1,1,1,1 access_vacation_other_line,vacation_other_line,model_vacation_other_line,base.group_user,1,1,1,1 +access_breastfeeding_holiday,breastfeeding_holiday,model_breastfeeding_holiday,base.group_user,1,1,1,1 +access_attendance_message_log,attendance_message_log,model_attendance_message_log,base.group_user,1,1,1,1 + access_yuthon_shift_planning,yuthon.shift.planning,model_yuthon_shift_planning,base.group_user,1,1,1,1 access_yuthon_shift_planning_a_line,yuthon.shift.planning.a.line,model_yuthon_shift_planning_a_line,base.group_user,1,1,1,1 diff --git a/yuthon_hr_attendance/views/go_approval.xml b/yuthon_hr_attendance/views/go_approval.xml index 922bbb8f7..646deede8 100644 --- a/yuthon_hr_attendance/views/go_approval.xml +++ b/yuthon_hr_attendance/views/go_approval.xml @@ -63,10 +63,9 @@ - - - + + @@ -74,6 +73,17 @@ + + + + + + + + + + + diff --git a/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml b/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml index 355de78c4..9743f92aa 100644 --- a/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml +++ b/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml @@ -34,6 +34,17 @@ + + + + + + + + + + + @@ -65,7 +76,7 @@ - + diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml index 4f98d3add..7545b5f89 100644 --- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml +++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml @@ -107,7 +107,7 @@ - +

@@ -233,6 +233,17 @@ + + + + + + + + + + + @@ -385,6 +396,17 @@ + + + + + + + + + + +