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 @@ -