diff --git a/hotel/data/hotel_demo.xml b/hotel/data/hotel_demo.xml
index 2f4cd2427..8a178cb52 100644
--- a/hotel/data/hotel_demo.xml
+++ b/hotel/data/hotel_demo.xml
@@ -253,6 +253,19 @@
10
+
+
+
+ Maintenance
+ Used for closing of rooms which require a maintenance.
+ You can specify the reason in the own reservation.
+
+
+
+ VIP Privacy
+ Used for closing of rooms for extra privacy.
+
+
@@ -319,6 +332,20 @@
+
+
+ out
+
+
+
+
+
diff --git a/hotel_calendar/models/bus_hotel_calendar.py b/hotel_calendar/models/bus_hotel_calendar.py
index ff6af8279..4c283843e 100644
--- a/hotel_calendar/models/bus_hotel_calendar.py
+++ b/hotel_calendar/models/bus_hotel_calendar.py
@@ -64,6 +64,8 @@ class BusHotelCalendar(models.TransientModel):
vals['checkin'],
num_split,
vals['price'],
+ vals['reservation_type'],
+ vals['out_service_description'],
]
}
diff --git a/hotel_calendar/models/inherited_hotel_reservation.py b/hotel_calendar/models/inherited_hotel_reservation.py
index b7d2c2e85..68ad6dccf 100644
--- a/hotel_calendar/models/inherited_hotel_reservation.py
+++ b/hotel_calendar/models/inherited_hotel_reservation.py
@@ -21,7 +21,8 @@ class HotelReservation(models.Model):
json_reservations.append([
reserv.room_id.id,
reserv.id,
- reserv.folio_id.partner_id.name,
+ reserv.folio_id.closure_reason_id.name or _('Out of service') if reserv.folio_id.reservation_type == 'out'
+ else reserv.folio_id.partner_id.name,
reserv.adults,
reserv.children,
reserv.checkin,
@@ -47,12 +48,15 @@ class HotelReservation(models.Model):
])
json_reservation_tooltips.update({
reserv.id: [
- reserv.folio_id.partner_id.name,
+ _('Out of service') if reserv.folio_id.reservation_type == 'out' else reserv.folio_id.partner_id.name,
reserv.folio_id.partner_id.mobile or
reserv.folio_id.partner_id.phone or _('Undefined'),
reserv.checkin,
num_split,
- reserv.folio_id.amount_total]
+ reserv.folio_id.amount_total,
+ reserv.reservation_type,
+ reserv.out_service_description or _('No reason given'),
+ ]
})
return (json_reservations, json_reservation_tooltips)
@@ -68,7 +72,7 @@ class HotelReservation(models.Model):
'id': room.id,
'name': room.name,
'capacity': room.capacity,
- 'class_id': room.room_type_id.class_id.id,
+ 'class_name': room.room_type_id.class_id.name,
'shared': room.shared_room,
'price': room.room_type_id
and ['pricelist', room.room_type_id.id, pricelist_id,
@@ -270,7 +274,8 @@ class HotelReservation(models.Model):
'title': ntitle,
'room_id': record.room_id.id,
'reserv_id': record.id,
- 'partner_name': record.partner_id.name,
+ 'partner_name': record.closure_reason_id.name or _('Out of service') if record.reservation_type == 'out'
+ else record.partner_id.name,
'adults': record.adults,
'children': record.children,
'checkin': record.checkin,
@@ -288,6 +293,9 @@ class HotelReservation(models.Model):
'fix_days': record.splitted,
'overbooking': record.overbooking,
'price': record.folio_id.amount_total,
+ 'reservation_type': record.reservation_type,
+ 'closure_reason_id': record.closure_reason_id or None,
+ 'out_service_description': record.out_service_description or _('No reason given')
})
@api.model
@@ -340,6 +348,8 @@ class HotelReservation(models.Model):
'checkout' in vals or 'product_id' in vals or \
'adults' in vals or 'children' in vals or \
'state' in vals or 'splitted' in vals or \
+ 'closure_reason_id' in vals or 'out_service_description' in vals or \
+ 'reservation_type' in vals or \
'reserve_color' in vals or \
'reserve_color_text' in vals or 'product_id' in vals or \
'parent_reservation' in vals or 'overbooking' in vals:
diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js
index 4dd69b277..5917e1c59 100644
--- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js
+++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js
@@ -113,7 +113,7 @@ var PMSCalendarController = AbstractController.extend({
r['id'],
r['name'],
r['capacity'],
- r['class_id'],
+ r['class_name'],
r['shared'],
r['price']
);
@@ -122,7 +122,7 @@ var PMSCalendarController = AbstractController.extend({
'room_type_id': r['room_type_id'],
'floor_id': r['floor_id'],
'amenities': r['amenity_ids'],
- 'class_id': r['class_id']
+ 'class_name': r['class_name']
});
rooms.push(nroom);
}
diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_renderer.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_renderer.js
index b9b96b69b..b3f54e498 100644
--- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_renderer.js
+++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_renderer.js
@@ -67,7 +67,9 @@ var HotelCalendarView = AbstractRenderer.extend({
'phone': tp[1],
'arrival_hour': HotelCalendar.toMomentUTC(tp[2], HotelConstants.ODOO_DATETIME_MOMENT_FORMAT).local().format('HH:mm'),
'num_split': tp[3],
- 'amount_total': Number(tp[4]).toLocaleString()
+ 'amount_total': Number(tp[4]).toLocaleString(),
+ 'reservation_type': tp[5],
+ 'out_service_description': tp[6]
};
},
@@ -772,7 +774,7 @@ var HotelCalendarView = AbstractRenderer.extend({
var virtual = _.map(this.$el.find('#pms-search #virtual_list').val(), function(item){ return +item; });
var domain = [];
if (category && category.length > 0) {
- domain.push(['class_id', 'in', category]);
+ domain.push(['class_name', 'in', category]);
}
if (floor && floor.length > 0) {
domain.push(['floor_id', 'in', floor]);
diff --git a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml
index eeb8195b4..ba0d55bee 100644
--- a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml
+++ b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml
@@ -70,15 +70,22 @@
-
+
+
+
+
+
+