From 5dcb00f75622f15c247f7440ff0972ba364c5601 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, 25 Dec 2025 19:36: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_will_task/models/inherit_room_booking.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/yuthon_will_task/models/inherit_room_booking.py b/yuthon_will_task/models/inherit_room_booking.py index a1b51261e..8a8cf84e3 100644 --- a/yuthon_will_task/models/inherit_room_booking.py +++ b/yuthon_will_task/models/inherit_room_booking.py @@ -5,19 +5,20 @@ from datetime import datetime, timedelta, date class InheritRoomBooking(models.Model): _inherit = 'room.booking' - def get_no_read_count(self): - today = date.today() + timedelta(hours=8) + today = date.today()+ timedelta(hours=8) today_start = datetime.combine(today, datetime.min.time()) today_end = datetime.combine(today, datetime.max.time()) + current_datetime = datetime.now() + timedelta(hours=8) domain = [ - ('company_id', '=', self.env.user.company_id.id), ('start_datetime', '>=', today_start), - ('start_datetime', '<=', today_end) + ('start_datetime', '<=', today_end), + '|', + ('end_datetime', '=', False), + ('end_datetime', '>', current_datetime) ] return self.search_count(domain) - @api.model def create(self, vals): task_time_ids = self.env['yuthon.task.time'].search([('name', '=', '30分钟')])