From 75b5cae76c1979d04ba5805f8c98d829955e10e4 Mon Sep 17 00:00:00 2001 From: Pablo Date: Tue, 29 Jan 2019 17:44:21 +0100 Subject: [PATCH] [ADD] Folio payment action --- .../calendar/hotel_calendar_controller.js | 22 ++++++++++++++++++- .../src/xml/hotel_calendar_templates.xml | 4 ++-- 2 files changed, 23 insertions(+), 3 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 dd0022e08..b4d1b10b4 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 @@ -425,7 +425,7 @@ var PMSCalendarController = AbstractController.extend({ type: 'ir.actions.act_window', res_model: 'hotel.folio', res_id: ev.data.folio_id, - views: [[false, 'form']] + views: [[false, 'form']], }); }); $reservationPopover.data('bs.popover').tip().find(".btn_popover_open_reservation").on('click', @@ -438,6 +438,26 @@ var PMSCalendarController = AbstractController.extend({ views: [[false, 'form']] }); }); + $reservationPopover.data('bs.popover').tip().find(".btn_popover_open_payment").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/xml/hotel_calendar_templates.xml b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml index a4c442008..ad58f453b 100644 --- a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml +++ b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml @@ -193,9 +193,9 @@ -
+
+ title="Folio Payments" />