From a60143651d9306110541077644bc07eb90479587 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: Thu, 23 Apr 2026 20:02:10 +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_issue/models/inherit_room_booking.py | 15 ++++++++++----- yuthon_notice/views/yuthon_notice_views.xml | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/yuthon_issue/models/inherit_room_booking.py b/yuthon_issue/models/inherit_room_booking.py index c24a1157d..1f72f07fb 100644 --- a/yuthon_issue/models/inherit_room_booking.py +++ b/yuthon_issue/models/inherit_room_booking.py @@ -99,11 +99,16 @@ class RoomBooking(models.Model): meet.issue_library_id.issue_state = False if self.code: - self.env['issue.library.approval.line'].create({ - 'issue_library_id': meet.issue_library_id.id, - 'code': self.code, - 'approval_date': fields.Datetime.now() + timedelta(hours=8), - }) + exists = self.env['issue.library.approval.line'].search([ + ('issue_library_id', '=', meet.issue_library_id.id), + ('code', '=', self.code) + ], limit=1) + if not exists: + self.env['issue.library.approval.line'].create({ + 'issue_library_id': meet.issue_library_id.id, + 'code': self.code, + 'approval_date': fields.Datetime.now() + timedelta(hours=8), + }) @api.depends_context('uid', 'company') @api.depends('company_id') diff --git a/yuthon_notice/views/yuthon_notice_views.xml b/yuthon_notice/views/yuthon_notice_views.xml index a931a9c7d..93e2b56fa 100644 --- a/yuthon_notice/views/yuthon_notice_views.xml +++ b/yuthon_notice/views/yuthon_notice_views.xml @@ -6,7 +6,7 @@ + decoration-muted="notice_state == 'stop'" default_order="create_date1 desc"> @@ -122,7 +122,7 @@ + js_class="custom_notice_tree_button" default_order="create_date1 desc">