From 7a83c26a390d6b11c70d1de67e83526cb9b2adf5 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Thu, 29 May 2025 12:05:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/models/hr_attendance.py | 14 +++++----- .../models/planning_template_inherit.py | 12 ++++++++ .../views/card_remind_form.xml | 10 +++++++ .../inherit_planning_slot_template_views.xml | 1 + .../models/inherit_res_groups.py | 28 +++++++++++++++---- 5 files changed, 53 insertions(+), 12 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index a3075fb78..db6f5525e 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -796,11 +796,11 @@ class HrAttendance(models.Model): 'is_approval': True, }) -class card_remind_form(models.Model): - _name = 'card.remind.form' - _description = '测试表单' + class card_remind_form(models.Model): + _name = 'card.remind.form' + _description = '测试表单' - name = fields.Char(string='姓名') - start_time = fields.Datetime(string='时间') - shift = fields.Char(string='班次') - department = fields.Char(string='部门') + name = fields.Char(string='姓名') + start_time = fields.Datetime(string='时间') + shift = fields.Char(string='班次') + department = fields.Char(string='部门') diff --git a/yuthon_hr_attendance/models/planning_template_inherit.py b/yuthon_hr_attendance/models/planning_template_inherit.py index 01d162ee4..9ce984e62 100644 --- a/yuthon_hr_attendance/models/planning_template_inherit.py +++ b/yuthon_hr_attendance/models/planning_template_inherit.py @@ -76,6 +76,18 @@ class PlanningSlotTemplate(models.Model): } return action + def template_timing_details(self): + name_pattern = f'%{self.department_id.name}%{self.planning_name}%打卡提醒%' + domain = [('name', 'ilike', name_pattern)] + action = { + 'name': '班次打卡详情', + 'type': 'ir.actions.act_window', + 'res_model': 'ir.cron', + 'view_mode': 'tree', + 'domain': domain, + } + return action + # @api.depends("planning_name") # def _compute_display_name(self): # super()._compute_display_name() diff --git a/yuthon_hr_attendance/views/card_remind_form.xml b/yuthon_hr_attendance/views/card_remind_form.xml index 95280946e..56324bca4 100644 --- a/yuthon_hr_attendance/views/card_remind_form.xml +++ b/yuthon_hr_attendance/views/card_remind_form.xml @@ -11,9 +11,19 @@ + + card.remind.search + card.remind.form + + + + + + 考勤提醒表单 card.remind.form tree + {'group_by': ['name', 'department']} \ No newline at end of file diff --git a/yuthon_hr_attendance/views/inherit_planning_slot_template_views.xml b/yuthon_hr_attendance/views/inherit_planning_slot_template_views.xml index e2ec8064b..fd75705e1 100644 --- a/yuthon_hr_attendance/views/inherit_planning_slot_template_views.xml +++ b/yuthon_hr_attendance/views/inherit_planning_slot_template_views.xml @@ -12,6 +12,7 @@