mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]rooms available filter
This commit is contained in:
@@ -135,16 +135,18 @@ class PmsRoomTypeAvailability(models.Model):
|
|||||||
("date", ">=", checkin),
|
("date", ">=", checkin),
|
||||||
("date", "<=", checkout - datetime.timedelta(1)),
|
("date", "<=", checkout - datetime.timedelta(1)),
|
||||||
]
|
]
|
||||||
|
if not current_lines:
|
||||||
|
current_lines = []
|
||||||
rooms_not_avail = (
|
rooms_not_avail = (
|
||||||
Avail.search(domain)
|
Avail.search(domain)
|
||||||
.reservation_line_ids.filtered(
|
.reservation_line_ids.filtered(lambda l: l.id not in current_lines)
|
||||||
lambda l: l.id not in current_lines if current_lines else []
|
|
||||||
)
|
|
||||||
.room_id.ids
|
.room_id.ids
|
||||||
)
|
)
|
||||||
domain_rooms = [
|
domain_rooms = []
|
||||||
("id", "not in", rooms_not_avail if rooms_not_avail else []),
|
if rooms_not_avail:
|
||||||
]
|
domain_rooms = [
|
||||||
|
("id", "not in", rooms_not_avail),
|
||||||
|
]
|
||||||
if pms_property_id:
|
if pms_property_id:
|
||||||
domain_rooms.append(("pms_property_id", "=", pms_property_id))
|
domain_rooms.append(("pms_property_id", "=", pms_property_id))
|
||||||
if room_type_id:
|
if room_type_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user