mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] Calendar Reservation Draw
This commit is contained in:
@@ -181,12 +181,15 @@ class HotelReservation(models.Model):
|
||||
rdfrom_dt = dfrom_dt + timedelta(days=1) # Ignore checkout
|
||||
reservations_raw = self.env['hotel.reservation'].search([
|
||||
('room_id', 'in', rooms.ids),
|
||||
'|', '&',
|
||||
'|', '|', '&',
|
||||
('checkin', '<=', dto_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)),
|
||||
('checkout', '>=', rdfrom_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)),
|
||||
'&',
|
||||
('checkin', '<=', dfrom_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)),
|
||||
('checkout', '>=', dto_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)),
|
||||
'&',
|
||||
('checkin', '>=', dfrom_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)),
|
||||
('checkout', '<=', dto_dt.strftime(DEFAULT_SERVER_DATE_FORMAT))
|
||||
('checkout', '<=', dto_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)),
|
||||
], order="checkin DESC, checkout ASC, adults DESC, children DESC")
|
||||
return self._hcalendar_reservation_data(reservations_raw)
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ function HotelCalendar(/*String*/querySelector, /*Dictionary*/options, /*List*/p
|
||||
this._reservationsMap = {}; // Store Reservations Mapped by Room for Search Purposes
|
||||
this._modeSwap = HotelCalendar.MODE.NONE; // Store Swap Mode
|
||||
this._selectionMode = HotelCalendar.MODE.NONE;
|
||||
this._endDate = this.options.startDate.clone().add(this.options.days+1, 'd'); // Store End Calendar Day
|
||||
this._endDate = this.options.startDate.clone().add(this.options.days, 'd'); // Store End Calendar Day
|
||||
this._tableCreated = false; // Store Flag to Know Calendar Creation
|
||||
this._cellSelection = {start:false, end:false, current:false}; // Store Info About Selected Cells
|
||||
this._lazyModeReservationsSelection = false; // Store Info About Timer for Selection Action
|
||||
@@ -152,7 +152,7 @@ HotelCalendar.prototype = {
|
||||
this.options.orig_days = days;
|
||||
this.options.days = this.parseDays(days) + 1;
|
||||
}
|
||||
this._endDate = this.options.startDate.clone().add(this.options.days+1, 'd');
|
||||
this._endDate = this.options.startDate.clone().add(this.options.days, 'd');
|
||||
|
||||
/*this.e.dispatchEvent(new CustomEvent(
|
||||
'hcOnChangeDate',
|
||||
|
||||
Reference in New Issue
Block a user