From 81a69f5a1d7657d806b6ffefd4ffd6814d0f00c2 Mon Sep 17 00:00:00 2001 From: Pablo Date: Tue, 22 Jan 2019 13:17:44 +0100 Subject: [PATCH] [DEL] Deleted Split information in popover At the moment it is better to prioritize performance. --- hotel_calendar/models/bus_hotel_calendar.py | 9 +-------- hotel_calendar/models/inherited_hotel_reservation.py | 12 +----------- .../js/views/calendar/hotel_calendar_controller.js | 2 +- .../static/src/xml/hotel_calendar_templates.xml | 4 ++-- .../static/src/xml/hotel_calendar_templates.xml | 4 ++-- 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/hotel_calendar/models/bus_hotel_calendar.py b/hotel_calendar/models/bus_hotel_calendar.py index c4a540c33..532a49b9d 100644 --- a/hotel_calendar/models/bus_hotel_calendar.py +++ b/hotel_calendar/models/bus_hotel_calendar.py @@ -23,13 +23,6 @@ class BusHotelCalendar(models.TransientModel): @api.model def _generate_reservation_notif(self, vals): user_id = self.env['res.users'].browse(self.env.uid) - master_reserv = vals['parent_reservation'] or vals['reserv_id'] - reserv_chunks = self.env['hotel.reservation'].search_count([ - ('folio_id', '=', vals['folio_id']), - '|', ('parent_reservation', '=', master_reserv), - ('id', '=', master_reserv), - ('splitted', '=', True), - ]) return { 'type': 'reservation', 'action': vals['action'], @@ -69,12 +62,12 @@ class BusHotelCalendar(models.TransientModel): 'checkout': vals['checkout'], 'arrival_hour': vals['arrival_hour'], 'departure_hour': vals['departure_hour'], - 'reserv_chunks': reserv_chunks, 'amount_total': vals['amount_total'], 'pending_amount': vals['pending_amount'], 'amount_paid': vals['amount_paid'], 'type': vals['reservation_type'], 'out_service_description': vals['out_service_description'], + 'splitted': vals['splitted'], 'channel_type': vals['channel_type'], } } diff --git a/hotel_calendar/models/inherited_hotel_reservation.py b/hotel_calendar/models/inherited_hotel_reservation.py index ad799266a..4ff64aa93 100644 --- a/hotel_calendar/models/inherited_hotel_reservation.py +++ b/hotel_calendar/models/inherited_hotel_reservation.py @@ -93,15 +93,6 @@ class HotelReservation(models.Model): 'overbooking': reserv['overbooking'], 'state': reserv['state'], 'real_dates': [reserv['real_checkin'], reserv['real_checkout']]}) - reserv_chunks = 1 - if reserv['splitted']: - master_reserv = reserv['parent_reservation'] or reserv['folio_id'] - reserv_chunks = self.search_count([ - ('folio_id', '=', reserv['folio_id']), - '|', ('parent_reservation', '=', master_reserv), - ('id', '=', master_reserv), - ('splitted', '=', True), - ]) json_reservation_tooltips.update({ reserv['id']: { 'folio_name': reserv['folio_id'], @@ -125,7 +116,6 @@ class HotelReservation(models.Model): 'out_service_description': reserv['out_service_description'] or _('No reason given'), 'splitted': reserv['splitted'], - 'reserv_chunks': reserv_chunks, 'channel_type': reserv['channel_type'], # TODO: Add Board Services and Extra Service as Cradle, Bed, ... } @@ -195,7 +185,7 @@ class HotelReservation(models.Model): SELECT hr.id, hr.room_id, hr.adults, hr.children, hr.checkin, hr.checkout, hr.reserve_color, hr.reserve_color_text, hr.splitted, hr.parent_reservation, hr.overbooking, hr.state, hr.real_checkin, hr.real_checkout, - hr.out_service_description, hr.arrival_hour, hr.departure_hour, hr.channel_type, hr.channel_type, + hr.out_service_description, hr.arrival_hour, hr.departure_hour, hr.channel_type, hf.id as folio_id, hf.name as folio_name, hf.reservation_type, hf.amount_total, hf.pending_amount, 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 e3be22b3c..4f19fba16 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 @@ -757,7 +757,7 @@ var PMSCalendarController = AbstractController.extend({ 'amount_paid': Number(tp['amount_paid']).toLocaleString(), 'reservation_type': tp['type'], 'out_service_description': tp['out_service_description'], - 'reserv_chunks': tp['reserv_chunks'], + 'splitted': tp['splitted'], 'channel_type': tp['channel_type'], }; }, diff --git a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml index 28c7a08a3..a1949bc52 100644 --- a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml +++ b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml @@ -131,8 +131,8 @@
- - This reservation has been splitted in chunks. + + This reservation is part of splitted reservation. You can check it in the corresponding Folio.
diff --git a/hotel_calendar_channel_connector/static/src/xml/hotel_calendar_templates.xml b/hotel_calendar_channel_connector/static/src/xml/hotel_calendar_templates.xml index 07a034b45..9a2f1c2c5 100644 --- a/hotel_calendar_channel_connector/static/src/xml/hotel_calendar_templates.xml +++ b/hotel_calendar_channel_connector/static/src/xml/hotel_calendar_templates.xml @@ -9,12 +9,12 @@
- WuBook ID: 1544109684 + WuBook: 1544109684
- ID: 4253096846 + : 4253096846