From d96bed775a7096b3658c048d6dfbe24866807514 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: Mon, 23 Feb 2026 20:22:04 +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_employee/models/yuthon_hr_employee.py | 3 +++
.../views/yuthon_hr_employee_views.xml | 2 +-
yuthon_notice/models/yuthon_notice.py | 14 ++------------
.../models/property_management.py | 10 ++++++++++
.../views/property_lease_contract.xml | 6 +++---
5 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py
index d89a8d29a..a29ad6644 100644
--- a/yuthon_hr_employee/models/yuthon_hr_employee.py
+++ b/yuthon_hr_employee/models/yuthon_hr_employee.py
@@ -253,6 +253,9 @@ class YuthonHrEmployee(models.Model):
('divorced', 'Divorced')
], string='Marital Status', groups="hr.group_hr_user", default='single', tracking=True)
+ def read_number(self):
+ return self.env['hr.employee'].search_count([('end_comparison', 'in', ['red', 'yellow', 'blue'])])
+
def update_role_group_ids(self):
employee_ids = self.env["hr.employee"].browse(
self._context.get("active_ids", self._context.get("active_id"))
diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
index f01539413..4f4a1d5b0 100644
--- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
+++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
@@ -629,7 +629,7 @@
+ domain="[('end_comparison', 'in', ['red', 'yellow', 'blue'])]"/>
diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py
index d13927e3b..4ce8f629f 100644
--- a/yuthon_notice/models/yuthon_notice.py
+++ b/yuthon_notice/models/yuthon_notice.py
@@ -204,7 +204,6 @@ class YuthonNotice(models.Model):
conf_old.write({'state': 'no'})
user_wecom_mapping = []
- we_id_list = []
for user_id in self.users_ids:
employee = self.env['hr.employee'].sudo().search(
[('user_id', '=', user_id.id)],
@@ -212,19 +211,10 @@ class YuthonNotice(models.Model):
)
if not employee:
continue
- emp_id = employee.id
- wecom_id = employee.wecom_userid
- user_wecom_mapping.append({'emp_id': emp_id, 'user_id': user_id})
- if wecom_id:
- we_id_list.append(wecom_id)
-
- msg_id = False
- touser = "|".join(we_id_list) if we_id_list else ""
- if touser:
- url = f'https://phone.thtzjt.com/phone/Notice/110?employee_id='
+ url = f'https://phone.thtzjt.com/phone/Notice/110?employee_id={employee.id}'
result_data = self.sudo().env["wecom.apps"].sync_send_message_textcard(
category='notice',
- touser=touser,
+ user_id=employee.wecom_userid,
title="通知公告",
description=self.name + '发布人:' + self.users_id.name,
url=url,
diff --git a/yuthon_property_approval/models/property_management.py b/yuthon_property_approval/models/property_management.py
index a2cd48916..f0e3b1eb0 100644
--- a/yuthon_property_approval/models/property_management.py
+++ b/yuthon_property_approval/models/property_management.py
@@ -85,6 +85,16 @@ class PropertyManagement(models.Model):
line.information_line_id.write({'end_date': fields.Date.today()})
# 直接从关联的上一条记录获取值(如果存在)
prev_info = line.information_line_id
+ target_start_time = record.start_time
+ target_property_id = line.property_id.id
+ existing_info = self.env['manage.information.line'].search([
+ ('yuthon_property_id', '=', target_property_id),
+ ('start_time', '=', target_start_time)
+ ], limit=1)
+ # 如果已有相同start_time的记录,跳过创建
+ if existing_info:
+ continue
+
# 创建新的信息行记录,从prev_info获取缺失的值
info_line_vals = {
'yuthon_property_id': line.property_id.id,
diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml
index 95cb93787..9d920685c 100644
--- a/yuthon_property_approval/views/property_lease_contract.xml
+++ b/yuthon_property_approval/views/property_lease_contract.xml
@@ -433,11 +433,11 @@
-
-
-
+
+