From a0c0b0dd119845427779ba391b1d99ff0defd075 Mon Sep 17 00:00:00 2001
From: zhouzhou <123@qq.com>
Date: Mon, 18 Nov 2024 20:49:22 +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/__manifest__.py | 1 +
.../data/attendance_time_data.xml | 18 ++++++++++++++++
yuthon_hr_attendance/models/hr_attendance.py | 7 ++++++-
.../views/hr_attendance_views.xml | 21 ++++++++++++++++++-
.../views/yuthon_duty_arrangement_views.xml | 2 +-
yuthon_work_brand/views/hr_menus.xml | 21 ++++++++++++++++++-
6 files changed, 66 insertions(+), 4 deletions(-)
create mode 100644 yuthon_hr_attendance/data/attendance_time_data.xml
diff --git a/yuthon_hr_attendance/__manifest__.py b/yuthon_hr_attendance/__manifest__.py
index 384c47965..be98574ed 100644
--- a/yuthon_hr_attendance/__manifest__.py
+++ b/yuthon_hr_attendance/__manifest__.py
@@ -17,6 +17,7 @@
'security/ir.model.access.csv',
# 'security/approval_attendance.xml',
'data/attendance_code_data.xml',
+ 'data/attendance_time_data.xml',
# 'views/inherit_hr_employee_views.xml',
'views/hr_attendance_views.xml',
'views/resource_calendar_leaves_views.xml',
diff --git a/yuthon_hr_attendance/data/attendance_time_data.xml b/yuthon_hr_attendance/data/attendance_time_data.xml
new file mode 100644
index 000000000..37abd0548
--- /dev/null
+++ b/yuthon_hr_attendance/data/attendance_time_data.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ 定时任务:检查考勤是否异
+
+ code
+ model.hr_attendance_time()
+
+
+ 1
+ days
+
+ -1
+
+
+
+
diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py
index e19475817..50e4329d0 100644
--- a/yuthon_hr_attendance/models/hr_attendance.py
+++ b/yuthon_hr_attendance/models/hr_attendance.py
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
+from datetime import datetime, time
+
from odoo import models, fields, api, exceptions, _
@@ -19,4 +21,7 @@ class HrAttendance(models.Model):
out_card_time = fields.Datetime(string="外出打卡时间")
out_card_location = fields.Char(string="外出打卡地点")
work_hours = fields.Float(string="工作时长")
- current_data = fields.Date(string='打卡日期', tracking=True)
\ No newline at end of file
+ current_data = fields.Date(string='打卡日期', tracking=True)
+
+ def hr_attendance_time(self):
+ pass
diff --git a/yuthon_hr_attendance/views/hr_attendance_views.xml b/yuthon_hr_attendance/views/hr_attendance_views.xml
index 804be310e..4bff90892 100644
--- a/yuthon_hr_attendance/views/hr_attendance_views.xml
+++ b/yuthon_hr_attendance/views/hr_attendance_views.xml
@@ -5,7 +5,8 @@
hr.attendance.going.tree
hr.attendance
-
+
@@ -30,4 +31,22 @@
hr.attendance
tree,form
+
+ 我的考勤
+ hr.attendance
+ tree,form
+ [('employee_id.user_id', '=', uid)]
+
+
+ 保安部考勤
+ hr.attendance
+ tree,form
+ [('employee_id.department_id.name', '=', '保安部')]
+
+
+ 工程部考勤
+ hr.attendance
+ tree,form
+ [('employee_id.department_id.name', '=', '工程部')]
+
diff --git a/yuthon_hr_attendance/views/yuthon_duty_arrangement_views.xml b/yuthon_hr_attendance/views/yuthon_duty_arrangement_views.xml
index 4ca727c63..3a7515964 100644
--- a/yuthon_hr_attendance/views/yuthon_duty_arrangement_views.xml
+++ b/yuthon_hr_attendance/views/yuthon_duty_arrangement_views.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index a317df192..8eae0542f 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -398,8 +398,27 @@
+
+
+
+