diff --git a/yuthon_holiday/__manifest__.py b/yuthon_holiday/__manifest__.py
index 4275f9740..6a6a9b8f3 100644
--- a/yuthon_holiday/__manifest__.py
+++ b/yuthon_holiday/__manifest__.py
@@ -9,6 +9,7 @@
'security/ir.model.access.csv',
'security/yuthon_holiday_group.xml',
'data/yuthon_holiday_data.xml',
+ 'data/mothly_report_time.xml',
'views/inherit_hr_type_views.xml',
'views/inherit_hr_leave_allocation_views.xml',
'views/inherit_hr_leave_accrual_plan_views.xml',
diff --git a/yuthon_holiday/data/mothly_report_time.xml b/yuthon_holiday/data/mothly_report_time.xml
new file mode 100644
index 000000000..a762fe747
--- /dev/null
+++ b/yuthon_holiday/data/mothly_report_time.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ 定时任务:生成我的考勤确认单
+
+ code
+ model.monthly_report()
+
+
+ 1
+ months
+
+ -1
+
+
+
+
diff --git a/yuthon_holiday/models/yuthon_vacation_reports.py b/yuthon_holiday/models/yuthon_vacation_reports.py
index f0b463a4e..8cf280782 100644
--- a/yuthon_holiday/models/yuthon_vacation_reports.py
+++ b/yuthon_holiday/models/yuthon_vacation_reports.py
@@ -38,6 +38,39 @@ class YuthonVacationReports(models.Model):
record.medical_fee = max(total, 0.0)
+ def monthly_report(self):
+ today = fields.Date.today()
+ employees = self.env['hr.employee'].search([])
+ for employee in employees:
+ existing_record = self.search([
+ ('employee_id', '=', employee.id),
+ ('vacation_date', '=', today)
+ ], limit=1)
+ if not existing_record:
+ self.create({
+ 'employee_id': employee.id,
+ 'vacation_date': today,
+ # 明细行和计算字段留空,由后续逻辑处理
+ })
+
+ def disposable_report(self):
+ year = 2025
+ months = range(1, 8) # 1到7月
+ employees = self.env['hr.employee'].search([])
+ for month in months:
+ report_date = fields.Date.from_string(f"{year}-{month:02d}-01")
+ for employee in employees:
+ existing = self.search([
+ ('employee_id', '=', employee.id),
+ ('vacation_date', '=', report_date)
+ ], limit=1)
+ if not existing:
+ self.create({
+ 'employee_id': employee.id,
+ 'vacation_date': report_date,
+ # 计算字段会自动触发,无需手动设置
+ })
+
def overtime_allocation(self):
form_id = self.env.ref('hr_holidays.hr_leave_allocation_view_form_manager').id
holiday_status_id = self.env['hr.leave.type'].search([('name', '=', '补休')])
diff --git a/yuthon_holiday/views/yuthon_vacation_reports_views.xml b/yuthon_holiday/views/yuthon_vacation_reports_views.xml
index a0ae22cda..f83a19262 100644
--- a/yuthon_holiday/views/yuthon_vacation_reports_views.xml
+++ b/yuthon_holiday/views/yuthon_vacation_reports_views.xml
@@ -10,6 +10,7 @@
+
@@ -152,6 +153,10 @@
+
+
+
+
@@ -263,15 +268,17 @@
假期额度日志
yuthon.vacation.reports
tree,form
+ {'search_default_group_by_employee_id': 1, 'search_default_group_by_vacation_date': True}
- 我的假期额度表单
+ 我的考勤确认
yuthon.vacation.reports
tree,form
[('employee_id.user_id', '=', uid)]
+ {'search_default_group_by_vacation_date': 1}
@@ -302,7 +309,7 @@
code
- action = model.batch_compute_leave_and_overtime()
+ action = model.disposable_report()
details.tree.tree
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index 80c25e721..3957e122c 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -628,7 +628,7 @@
action="yuthon_hr_attendance.hr_attendance_my_abnormal"
sequence="6"/>