From 8cdc0040a6ff051c9fce86fdae6d97b68a554d65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Sun, 12 Oct 2025 11:00:43 +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
---
attendance_iot/models/attendance_iot_manager.py | 1 +
.../views/attendance_iot_manager_views.xml | 1 +
.../models/yuthon_vacation_reports.py | 11 ++++++-----
yuthon_hr_employee/models/yuthon_hr_employee.py | 2 +-
.../models/yuthon_onboard_approval.py | 8 ++++++++
.../views/property_lease_contract.xml | 14 ++++++++++++++
6 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/attendance_iot/models/attendance_iot_manager.py b/attendance_iot/models/attendance_iot_manager.py
index 74a16866c..4bd9342df 100644
--- a/attendance_iot/models/attendance_iot_manager.py
+++ b/attendance_iot/models/attendance_iot_manager.py
@@ -15,6 +15,7 @@ class AttendanceIotManager(models.Model):
attendance_iot_id = fields.Many2one('attendance.iot', string="设备号")
attendance_address = fields.Char(string="设备地址")
data_selection = fields.Selection([('mqtt', 'mqtt'), ('api', 'api')], default="mqtt", string="数据类型")
+ remarks = fields.Text(string='备注')
def action_attendance_iot_manager(self):
return {
diff --git a/attendance_iot/views/attendance_iot_manager_views.xml b/attendance_iot/views/attendance_iot_manager_views.xml
index 63bd93fc5..46b34496f 100644
--- a/attendance_iot/views/attendance_iot_manager_views.xml
+++ b/attendance_iot/views/attendance_iot_manager_views.xml
@@ -8,6 +8,7 @@
+
diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py
index fe92ecfa3..4124bfc30 100644
--- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py
+++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py
@@ -120,7 +120,6 @@ class YuthonVacationReports(models.Model):
return action
-
def confirm_state(self):
for rec in self:
rec.vacation_state = 'confirmed'
@@ -130,7 +129,6 @@ class YuthonVacationReports(models.Model):
next_month_date = current_date.replace(year=current_date.year + 1, month=1, day=1)
else:
next_month_date = current_date.replace(month=current_date.month + 1, day=1)
-
# 查找下个月是否已有该员工的记录
next_month_record = self.search([
('employee_id', '=', rec.employee_id.id),
@@ -225,8 +223,11 @@ class YuthonVacationReports(models.Model):
records = self.env["yuthon.vacation.reports"].browse(
self._context.get('active_ids', self._context.get('active_id', self.ids))
)
+ august_start = fields.Date.from_string('2025-10-01')
for rec in records:
- rec._compute_attendance_fields1()
+ rec.write({
+ 'vacation_date': august_start,
+ })
def update_data(self):
august_start = fields.Date.from_string('2025-09-01')
@@ -612,7 +613,7 @@ class YuthonVacationReports(models.Model):
# 创建本月报告主记录(包含继承的值)
new_report = self.create({
'employee_id': employee.id,
- 'vacation_date': today,
+ 'vacation_date': current_month_first,
**inherit_vals
})
@@ -630,7 +631,7 @@ class YuthonVacationReports(models.Model):
# 如果没有已确认的上月记录,创建空的本月报告
self.create({
'employee_id': employee.id,
- 'vacation_date': today,
+ 'vacation_date': current_month_first,
})
def _update_leave_lines(self, report, allocations, number_of_hours_display):
diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py
index 77ba9fcb2..a8438a724 100644
--- a/yuthon_hr_employee/models/yuthon_hr_employee.py
+++ b/yuthon_hr_employee/models/yuthon_hr_employee.py
@@ -338,7 +338,7 @@ class YuthonHrEmployee(models.Model):
@api.onchange('user_role_id')
def _onchange_user_role_id(self):
- if self.user_role_id and self.id:
+ if self.user_role_id:
user_id = self.env['soong.user.role'].search([('id', '=', self.user_role_id.id)])
user_id.write({'personnel_ids': [(4, self.id.origin)]})
diff --git a/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py b/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
index 3e9561a3b..4416df7b4 100644
--- a/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
@@ -218,6 +218,14 @@ class YuthonOnboardApproval(models.Model):
'is_probation': True,
})
+ vacation_date = self.duration_employment.replace(day=1)
+ self.env['yuthon.vacation.reports'].search([('employee_id', '=', employee_id.id), ('vacation_date', '=', self.vacation_date)])
+ if not vacation_date:
+ self.env['yuthon.vacation.reports'].create({
+ 'employee_id': employee_id.id,
+ 'vacation_date': vacation_date,
+ })
+
@api.onchange('employee_name')
def _onchange_employee_id(self):
for record in self:
diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml
index e03a8e6c7..6c94fb791 100644
--- a/yuthon_property_approval/views/property_lease_contract.xml
+++ b/yuthon_property_approval/views/property_lease_contract.xml
@@ -784,13 +784,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+