mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms_api_rest: changed reservation overbooking for reservation line overbooking in planning alert per days service
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user