[FIX] filter check availability by room_ids

This commit is contained in:
Pablo
2019-03-12 19:21:19 +01:00
committed by Dario Lodeiros
parent e896e491d3
commit de8798227b

View File

@@ -75,14 +75,14 @@ class HotelRoomType(models.Model):
@param dfrom: Range date from
@param dto: Range date to
@param room_type_id: Room Type
@param notthis: Array excluding Room Types
@param notthis: Array excluding Rooms
@return: A recordset of free rooms ?
"""
reservations = self.env['hotel.reservation'].get_reservations(dfrom, dto)
reservations_rooms = reservations.mapped('room_id.id')
free_rooms = self.env['hotel.room'].search([
('id', 'not in', reservations_rooms),
('room_type_id.id', 'not in', notthis)
('id', 'not in', notthis)
])
if room_type_id:
rooms_linked = self.env['hotel.room.type'].search([