From 502564703cd2b8bbe54990ce1e1367e0a490ec1d Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Thu, 17 Jul 2025 16:44:36 +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
---
.../models/yuthon_vacation_reports.py | 16 +++
.../views/yuthon_vacation_reports_views.xml | 100 +++++++++++++++++-
2 files changed, 111 insertions(+), 5 deletions(-)
diff --git a/yuthon_holiday/models/yuthon_vacation_reports.py b/yuthon_holiday/models/yuthon_vacation_reports.py
index 1460b55fc..14f4ca568 100644
--- a/yuthon_holiday/models/yuthon_vacation_reports.py
+++ b/yuthon_holiday/models/yuthon_vacation_reports.py
@@ -18,6 +18,22 @@ class YuthonVacationReports(models.Model):
working_overtime = fields.Float(string='加班时', compute='_compute_working_overtime', store=True)
meal_fee = fields.Integer(string="误餐次数", compute='_compute_meal_fee', store=True)
+ 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', '=', '补休')])
+ return {
+ 'name': '补休时分配',
+ 'view_mode': 'form',
+ 'res_model': 'hr.leave.allocation',
+ 'type': 'ir.actions.act_window',
+ 'views': [(form_id, 'form')],
+ 'context': {
+ 'default_holiday_status_id': holiday_status_id.id,
+ 'default_employee_ids': [(6, 0, [self.employee_id.id])],
+ 'default_allocation_type': 'regular',
+ 'default_name': '补休增加',
+ }}
+
def update_vac(self):
vacation_ids = self.env["yuthon.vacation.reports"].browse(
self._context.get('active_ids', self._context.get('active_id')))
diff --git a/yuthon_holiday/views/yuthon_vacation_reports_views.xml b/yuthon_holiday/views/yuthon_vacation_reports_views.xml
index c635d1bd9..33f6c0fcb 100644
--- a/yuthon_holiday/views/yuthon_vacation_reports_views.xml
+++ b/yuthon_holiday/views/yuthon_vacation_reports_views.xml
@@ -4,7 +4,7 @@
yuthon.vacation.reports.tree
yuthon.vacation.reports
-
+
@@ -19,9 +19,20 @@
yuthon.vacation.reports.form
yuthon.vacation.reports
-
+
+ yuthon.vacation.reports.form
+ yuthon.vacation.reports
+
+
+
+
- 假期额度记录
+ 假期额度日志
yuthon.vacation.reports
tree,form
+
我的假期额度
yuthon.vacation.reports
- tree,form
+ form
[('employee_id.user_id', '=', uid)]
+
更新报表