[IMP]pms_api_rest: changed reservation overbooking for reservation line overbooking in planning alert per days service

This commit is contained in:
braisab
2022-04-29 17:19:49 +02:00
committed by Darío Lodeiros
parent fd71d882ea
commit dbf82825be

View File

@@ -283,13 +283,13 @@ class PmsCalendarService(Component):
date_from + timedelta(d) for d in range((date_to - date_from).days + 1) date_from + timedelta(d) for d in range((date_to - date_from).days + 1)
): ):
overbooking = False overbooking = False
reservations = self.env["pms.reservation"].search( lines = self.env["pms.reservation.line"].search(
[ [
("checkin", "=", day), ("date", "=", day),
("pms_property_id", "=", pms_calendar_search_param.pms_property_id), ("pms_property_id", "=", pms_calendar_search_param.pms_property_id),
] ]
) )
if any(reservation.overbooking for reservation in reservations): if any(line.overbooking for line in lines):
overbooking = True overbooking = True
result.append( result.append(
PmsCalendarAlertsPerDay( PmsCalendarAlertsPerDay(