diff --git a/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py b/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py index 318747ba0..9ded708a7 100644 --- a/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py +++ b/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py @@ -11,6 +11,7 @@ class HotelReservation(models.Model): @api.multi def _hcalendar_reservation_data(self, reservations): vals = super(HotelReservation, self)._hcalendar_reservation_data(reservations) + # TODO: Improve performance by doing a SQL as in get_hcalendar_reservations_data() hotel_reservation_obj = self.env['hotel.reservation'] for v_rval in vals[0]: reserv = hotel_reservation_obj.browse(v_rval['id']) @@ -18,9 +19,12 @@ class HotelReservation(models.Model): 'fix_days': reserv.splitted or reserv.is_from_ota, }) # Update tooltips - vals[1][reserv.id].update({ - 'ota_name': reserv.channel_bind_ids[0].ota_id.name if any(reserv.channel_bind_ids) else False - }) + if any(reserv.channel_bind_ids): + vals[1][reserv.id].update({ + 'ota_name': reserv.channel_bind_ids[0].ota_id.name, + 'ota_reservation_id': reserv.channel_bind_ids[0].ota_reservation_id, + 'external_id': reserv.channel_bind_ids[0].external_id, + }) return vals @api.multi diff --git a/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_controller.js b/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_controller.js index 81199de0d..6db4a1fe3 100644 --- a/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_controller.js +++ b/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_controller.js @@ -34,6 +34,8 @@ var PMSHotelCalendarController = PMSCalendarController.include({ _generate_reservation_tooltip_dict: function(tp) { var qdict = this._super(tp); qdict['ota_name'] = tp['ota_name']; + qdict['ota_reservation_id'] = tp['ota_reservation_id']; + qdict['external_id'] = tp['external_id']; return qdict; }, 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 9a2f1c2c5..9210f655e 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,14 +9,16 @@
- WuBook: 1544109684 + WuBook:
-
-
- : 4253096846 + +
+
+ : +
-
+