mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
Merge branch '11.0' of https://github.com/hootel/hootel into 11.0
This commit is contained in:
@@ -755,7 +755,7 @@ class HotelReservation(models.Model):
|
||||
def onchange_room_availabiltiy_domain(self):
|
||||
self.ensure_one()
|
||||
if self.checkin and self.checkout:
|
||||
if self.overbooking or self.reselling:
|
||||
if self.overbooking or self.reselling or self.state in ('cancelled'):
|
||||
return
|
||||
occupied = self.env['hotel.reservation'].get_reservations(
|
||||
self.checkin,
|
||||
@@ -1155,7 +1155,9 @@ class HotelReservation(models.Model):
|
||||
if fields.Date.from_string(self.checkin) >= fields.Date.from_string(self.checkout):
|
||||
raise ValidationError(_('Room line Check In Date Should be \
|
||||
less than the Check Out Date!'))
|
||||
if not self.overbooking and not self._context.get("ignore_avail_restrictions", False):
|
||||
if not self.overbooking \
|
||||
and self.state not in ('cancelled') \
|
||||
and not self._context.get("ignore_avail_restrictions", False):
|
||||
occupied = self.env['hotel.reservation'].get_reservations(
|
||||
self.checkin,
|
||||
(fields.Date.from_string(self.checkout) - timedelta(days=1)).
|
||||
|
||||
@@ -92,24 +92,6 @@ var CalendarMenu = Widget.extend({
|
||||
return $.when();
|
||||
},
|
||||
|
||||
toggle_show_adv_controls: function() {
|
||||
var $pms_search = $(document).find('#pms-search');
|
||||
if ($pms_search.position().top < 0)
|
||||
{
|
||||
var $navbar = $('.navbar');
|
||||
var toPos = $navbar.height() + parseInt($navbar.css('border-top-width'), 10) + parseInt($navbar.css('border-bottom-width'), 10);
|
||||
$pms_search.animate({
|
||||
'top': `${toPos}px`,
|
||||
'opacity': 1.0,
|
||||
}, 'fast');
|
||||
} else {
|
||||
$pms_search.animate({
|
||||
'top': `-${$pms_search.height()}px`,
|
||||
'opacity': 0.0,
|
||||
}, 'slow');
|
||||
}
|
||||
},
|
||||
|
||||
toggle_show_notification: function() {
|
||||
this._show_notifications = !this._show_notifications;
|
||||
this._rpc({
|
||||
|
||||
@@ -370,12 +370,10 @@
|
||||
</t>
|
||||
|
||||
<t t-name="HotelCalendar.SettingsMenu.Global">
|
||||
<li><a href="#" data-action="toggle_show_adv_controls">Toggle Advance Controls</a></li>
|
||||
<li class="divider"/>
|
||||
<li><a href="#" data-action="toggle_show_notification"><span t-if="manager._show_notifications" class="fa fa-check"/> Show Notifications</a></li>
|
||||
<li><a href="#" data-action="toggle_show_pricelist"><span t-if="manager._show_pricelist" class="fa fa-check"/> Show Pricelist</a></li>
|
||||
<li><a href="#" data-action="toggle_show_availability"><span t-if="manager._show_availability" class="fa fa-check"/> Show Availability</a></li>
|
||||
<li><a href="#" data-action="toggle_show_divide_rooms_by_capacity"><span t-if="manager._show_divide_rooms_by_capacity" class="fa fa-check"/> Divide Rooms by Capacity</a></li>
|
||||
<li><a href="#" data-action="toggle_show_pricelist"><span t-if="manager._show_pricelist" class="fa fa-check"/> Show Pricelist</a></li>
|
||||
<li><a href="#" data-action="toggle_show_availability"><span t-if="manager._show_availability" class="fa fa-check"/> Show Availability</a></li>
|
||||
<li><a href="#" data-action="toggle_show_divide_rooms_by_capacity"><span t-if="manager._show_divide_rooms_by_capacity" class="fa fa-check"/> Divide Rooms by Capacity</a></li>
|
||||
</t>
|
||||
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user