From c6018601a14d50210ad99d95f30a977df04faece Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 21 Jan 2019 18:55:46 +0100 Subject: [PATCH] [WIP] Channel OTA info using template inheritance --- hotel_calendar/models/bus_hotel_calendar.py | 1 + .../models/inherited_hotel_reservation.py | 4 +++- .../calendar/hotel_calendar_controller.js | 1 + .../src/xml/hotel_calendar_templates.xml | 19 ++++++++++++++----- .../src/xml/hotel_calendar_templates.xml | 15 ++++++++++++--- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/hotel_calendar/models/bus_hotel_calendar.py b/hotel_calendar/models/bus_hotel_calendar.py index 2bb4d5289..c4a540c33 100644 --- a/hotel_calendar/models/bus_hotel_calendar.py +++ b/hotel_calendar/models/bus_hotel_calendar.py @@ -75,6 +75,7 @@ class BusHotelCalendar(models.TransientModel): 'amount_paid': vals['amount_paid'], 'type': vals['reservation_type'], 'out_service_description': vals['out_service_description'], + 'channel_type': vals['channel_type'], } } diff --git a/hotel_calendar/models/inherited_hotel_reservation.py b/hotel_calendar/models/inherited_hotel_reservation.py index 30950071d..ad799266a 100644 --- a/hotel_calendar/models/inherited_hotel_reservation.py +++ b/hotel_calendar/models/inherited_hotel_reservation.py @@ -126,6 +126,7 @@ class HotelReservation(models.Model): 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, ... } }) @@ -194,7 +195,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.out_service_description, hr.arrival_hour, hr.departure_hour, hr.channel_type, hr.channel_type, hf.id as folio_id, hf.name as folio_name, hf.reservation_type, hf.amount_total, hf.pending_amount, @@ -418,6 +419,7 @@ class HotelReservation(models.Model): 'out_service_description': self.out_service_description or _('No reason given'), 'real_dates': [self.real_checkin, self.real_checkout], + 'channel_type': self.channel_type, } @api.multi 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 af954f15a..e3be22b3c 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 @@ -758,6 +758,7 @@ var PMSCalendarController = AbstractController.extend({ 'reservation_type': tp['type'], 'out_service_description': tp['out_service_description'], 'reserv_chunks': tp['reserv_chunks'], + '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 9af70a5e0..28c7a08a3 100644 --- a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml +++ b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml @@ -84,14 +84,23 @@ - -

WuBook: 1544109684

-

Booking: 4253096846

+
-

Sales Channel Direct

+
+
+ Sales Channel: +
+
+
+
+ + TODO: add call center information + +
+
@@ -141,7 +150,7 @@

Total Paid

- + 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 e4382ec4e..07a034b45 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 @@ -5,9 +5,18 @@ - - -
  • OTA:
  • + + +
    +
    + WuBook ID: 1544109684 +
    +
    +
    +
    + ID: 4253096846 +
    +