[WIP] Adding actions

This commit is contained in:
Pablo
2019-01-30 12:44:13 +01:00
parent 1d4464a039
commit a753302439
3 changed files with 24 additions and 7 deletions

View File

@@ -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();
});

View File

@@ -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();

View File

@@ -191,7 +191,7 @@
<span class="fa fa-suitcase fa-2x" role="button"
title="View Reservation Details" />
</div>
<div class="col-sm-2">
<div class="col-sm-2 btn_popover_open_checkin">
<span class="fa fa-user-plus fa-2x" role="button"
title="Checkin" />
</div>
@@ -212,7 +212,7 @@
</t>
</t>
<t t-if="splitted">
<p>This reservation is part of splitted reservation. You can check it in the corresponding Folio.</p>
<p><i class="fa fa-exclamation-circle"/>This reservation is part of splitted reservation.</p>
</t>
</div>
</div>
@@ -267,7 +267,7 @@
</div>
<t t-call="HotelCalendar.TooltipReservation.Dates"/>
<div class="row row-eq-height mt-10">
<div class="col-sm-2 btn_popover_open_folio">
<div class="col-sm-4 btn_popover_open_folio">
<i class="fa fa-file-text-o fa-2x fa-pull-left" role="button"
title="View Folio Details"> <span class="fa-text-inside"><t t-esc="folio_name"/></span></i>
</div>
@@ -275,10 +275,6 @@
<span class="fa fa-suitcase fa-2x" role="button"
title="View Reservation Details" />
</div>
<div class="col-sm-2 btn_popover_close">
<span class="fa fa-window-close fa-2x" role="button"
title="Close" />
</div>
</div>
</div>