[DEL] Deleted Split information in popover

At the moment it is better to prioritize performance.
This commit is contained in:
Pablo
2019-01-22 13:17:44 +01:00
parent c6018601a1
commit 81a69f5a1d
5 changed files with 7 additions and 24 deletions

View File

@@ -23,13 +23,6 @@ class BusHotelCalendar(models.TransientModel):
@api.model
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']
reserv_chunks = self.env['hotel.reservation'].search_count([
('folio_id', '=', vals['folio_id']),
'|', ('parent_reservation', '=', master_reserv),
('id', '=', master_reserv),
('splitted', '=', True),
])
return {
'type': 'reservation',
'action': vals['action'],
@@ -69,12 +62,12 @@ class BusHotelCalendar(models.TransientModel):
'checkout': vals['checkout'],
'arrival_hour': vals['arrival_hour'],
'departure_hour': vals['departure_hour'],
'reserv_chunks': reserv_chunks,
'amount_total': vals['amount_total'],
'pending_amount': vals['pending_amount'],
'amount_paid': vals['amount_paid'],
'type': vals['reservation_type'],
'out_service_description': vals['out_service_description'],
'splitted': vals['splitted'],
'channel_type': vals['channel_type'],
}
}

View File

@@ -93,15 +93,6 @@ 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'],
@@ -125,7 +116,6 @@ class HotelReservation(models.Model):
'out_service_description': reserv['out_service_description']
or _('No reason given'),
'splitted': reserv['splitted'],
'reserv_chunks': reserv_chunks,
'channel_type': reserv['channel_type'],
# TODO: Add Board Services and Extra Service as Cradle, Bed, ...
}
@@ -195,7 +185,7 @@ class HotelReservation(models.Model):
SELECT
hr.id, hr.room_id, hr.adults, hr.children, hr.checkin, hr.checkout, hr.reserve_color, hr.reserve_color_text,
hr.splitted, hr.parent_reservation, hr.overbooking, hr.state, hr.real_checkin, hr.real_checkout,
hr.out_service_description, hr.arrival_hour, hr.departure_hour, hr.channel_type, hr.channel_type,
hr.out_service_description, hr.arrival_hour, hr.departure_hour, hr.channel_type,
hf.id as folio_id, hf.name as folio_name, hf.reservation_type, hf.amount_total, hf.pending_amount,

View File

@@ -757,7 +757,7 @@ var PMSCalendarController = AbstractController.extend({
'amount_paid': Number(tp['amount_paid']).toLocaleString(),
'reservation_type': tp['type'],
'out_service_description': tp['out_service_description'],
'reserv_chunks': tp['reserv_chunks'],
'splitted': tp['splitted'],
'channel_type': tp['channel_type'],
};
},

View File

@@ -131,8 +131,8 @@
</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 t-if="splitted">
This reservation is part of splitted reservation. You can check it in the corresponding Folio.
</t>
</div>
</t>

View File

@@ -9,12 +9,12 @@
<t t-jquery="#channel_info" t-operation="replace">
<div class="row row-eq-height">
<div class="col-sm-12 bg-gray-light">
WuBook ID: 1544109684
WuBook: 1544109684
</div>
</div>
<div class="row row-eq-height">
<div class="col-sm-12 bg-gray-light">
<t t-esc="ota_name"/> ID: 4253096846
<t t-esc="ota_name"/>: 4253096846
</div>
</div>
</t>