mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD] Split information in popover
This commit is contained in:
@@ -24,7 +24,7 @@ class BusHotelCalendar(models.TransientModel):
|
||||
def _generate_reservation_notif(self, vals):
|
||||
user_id = self.env['res.users'].browse(self.env.uid)
|
||||
master_reserv = vals['parent_reservation'] or vals['reserv_id']
|
||||
num_split = self.env['hotel.reservation'].search_count([
|
||||
reserv_chunks = self.env['hotel.reservation'].search_count([
|
||||
('folio_id', '=', vals['folio_id']),
|
||||
'|', ('parent_reservation', '=', master_reserv),
|
||||
('id', '=', master_reserv),
|
||||
@@ -69,7 +69,7 @@ class BusHotelCalendar(models.TransientModel):
|
||||
'checkout': vals['checkout'],
|
||||
'arrival_hour': vals['arrival_hour'],
|
||||
'departure_hour': vals['departure_hour'],
|
||||
'num_split': num_split,
|
||||
'reserv_chunks': reserv_chunks,
|
||||
'amount_total': vals['amount_total'],
|
||||
'pending_amount': vals['pending_amount'],
|
||||
'amount_paid': vals['amount_paid'],
|
||||
|
||||
@@ -93,6 +93,15 @@ class HotelReservation(models.Model):
|
||||
'overbooking': reserv['overbooking'],
|
||||
'state': reserv['state'],
|
||||
'real_dates': [reserv['real_checkin'], reserv['real_checkout']]})
|
||||
reserv_chunks = 1
|
||||
if reserv['splitted']:
|
||||
master_reserv = reserv['parent_reservation'] or reserv['folio_id']
|
||||
reserv_chunks = self.search_count([
|
||||
('folio_id', '=', reserv['folio_id']),
|
||||
'|', ('parent_reservation', '=', master_reserv),
|
||||
('id', '=', master_reserv),
|
||||
('splitted', '=', True),
|
||||
])
|
||||
json_reservation_tooltips.update({
|
||||
reserv['id']: {
|
||||
'folio_name': reserv['folio_id'],
|
||||
@@ -115,9 +124,12 @@ class HotelReservation(models.Model):
|
||||
'type': reserv['reservation_type'] or 'normal',
|
||||
'out_service_description': reserv['out_service_description']
|
||||
or _('No reason given'),
|
||||
'splitted': reserv['splitted'],
|
||||
'reserv_chunks': reserv_chunks,
|
||||
# TODO: Add Board Services and Extra Service as Cradle, Bed, ...
|
||||
}
|
||||
})
|
||||
|
||||
return (json_reservations, json_reservation_tooltips)
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -756,7 +756,8 @@ var PMSCalendarController = AbstractController.extend({
|
||||
'pending_amount': Number(tp['pending_amount']).toLocaleString(),
|
||||
'amount_paid': Number(tp['amount_paid']).toLocaleString(),
|
||||
'reservation_type': tp['type'],
|
||||
'out_service_description': tp['out_service_description']
|
||||
'out_service_description': tp['out_service_description'],
|
||||
'reserv_chunks': tp['reserv_chunks'],
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -121,6 +121,11 @@
|
||||
title="Close" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-eq-height mt-10">
|
||||
<t t-if="reserv_chunks > 1">
|
||||
This reservation has been splitted in <t t-esc="reserv_chunks"/> chunks.
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="HotelCalendar.TooltipReservation.Sale">
|
||||
@@ -136,7 +141,7 @@
|
||||
<p>Total Paid</p>
|
||||
</div>
|
||||
<div class="col-sm-6 bg-gray-light">
|
||||
<t t-if="channel_type == 'web' or channel_type=='call'">
|
||||
<t t-if="channel_type == 'web' or channel_type =='call'">
|
||||
<t t-call="HotelCalendar.TooltipReservation.Channel.ota"/>
|
||||
</t>
|
||||
<t t-else="reservation_type == 'out'">
|
||||
|
||||
Reference in New Issue
Block a user