[IMP] real avail compute on hcalendar management

This commit is contained in:
Dario Lodeiros
2019-04-16 09:57:07 +02:00
parent 8db98963d9
commit 8f0fc07457
2 changed files with 26 additions and 6 deletions

View File

@@ -1088,10 +1088,13 @@ class HotelReservation(models.Model):
@return: array with the reservations _confirmed_ between both dates `dfrom` and `dto`
"""
domain = self._get_domain_reservations_occupation(dfrom, dto)
_logger.info(domain)
return self.env['hotel.reservation'].search(domain)
@api.model
def _get_domain_reservations_occupation(self, dfrom, dto):
#WARNING If add or remove domain items, update _hcalendar_get_count_reservations_json_data
# in calendar module hotel_calendar_management.py
domain = [('reservation_line_ids.date', '>=', dfrom),
('reservation_line_ids.date', '<=', dto),
('state', '!=', 'cancelled'),