From a753302439430a342678ec96ce1a4b1ec8081977 Mon Sep 17 00:00:00 2001 From: Pablo Date: Wed, 30 Jan 2019 12:44:13 +0100 Subject: [PATCH] [WIP] Adding actions --- .../calendar/hotel_calendar_controller.js | 20 +++++++++++++++++++ .../static/src/lib/hcalendar/js/hcalendar.js | 1 + .../src/xml/hotel_calendar_templates.xml | 10 +++------- 3 files changed, 24 insertions(+), 7 deletions(-) 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 8ea8afd0f..ce5217931 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 @@ -453,6 +453,26 @@ var PMSCalendarController = AbstractController.extend({ }); }); }); + $reservationPopover.data('bs.popover').tip().find(".btn_popover_open_checkin").on('click', + {reservation_id: ev.detail.reservationObj.id}, function(ev){ + _destroy_and_clear_popover_mark(); + var x = self._rpc({ + model: 'hotel.reservation', + method: 'action_pay_folio', + args: [ev.data.reservation_id], + }).then(function (result){ + return self.do_action({ + name: result.name, + view_type: result.view_type, + view_mode: result.view_mode, + type: result.type, + res_model: result.res_model, + views: [[result.view_id, 'form']], + context: result.context, + target: result.target, + }); + }); + }); $reservationPopover.data('bs.popover').tip().find(".btn_popover_close").on('click', function(ev){ _destroy_and_clear_popover_mark(); }); diff --git a/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js b/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js index f57934073..f4474dce1 100644 --- a/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js +++ b/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js @@ -2496,6 +2496,7 @@ HotelCalendar.prototype = { $('.hcal-reservation').removeClass("marked-as-having-a-popover"); } else { // FIXME: Prevent multiple clicks in a row + debugger; this._cellSelection.start = this._cellSelection.current = ev.target; this._cellSelection.end = false; this._updateCellSelection(); diff --git a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml index ba40ec5f1..a6cc0e532 100644 --- a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml +++ b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml @@ -191,7 +191,7 @@ -
+
@@ -212,7 +212,7 @@ -

This reservation is part of splitted reservation. You can check it in the corresponding Folio.

+

This reservation is part of splitted reservation.

@@ -267,7 +267,7 @@
-
+
@@ -275,10 +275,6 @@
-
- -