[ADD] Show out of service reason

This commit is contained in:
Pablo
2018-12-06 08:49:37 +01:00
parent 604ccdd624
commit ff70012c05
3 changed files with 26 additions and 13 deletions

View File

@@ -21,7 +21,8 @@ class HotelReservation(models.Model):
json_reservations.append([
reserv.room_id.id,
reserv.id,
reserv.folio_id.partner_id.name,
reserv.folio_id.closure_reason_id.name or _('Out of service') if reserv.folio_id.reservation_type == 'out'
else reserv.folio_id.partner_id.name,
reserv.adults,
reserv.children,
reserv.checkin,
@@ -47,12 +48,15 @@ class HotelReservation(models.Model):
])
json_reservation_tooltips.update({
reserv.id: [
reserv.folio_id.partner_id.name,
_('Out of service') if reserv.folio_id.reservation_type == 'out' else reserv.folio_id.partner_id.name,
reserv.folio_id.partner_id.mobile or
reserv.folio_id.partner_id.phone or _('Undefined'),
reserv.checkin,
num_split,
reserv.folio_id.amount_total]
reserv.folio_id.amount_total,
reserv.reservation_type,
reserv.out_service_description or _('No reason given'),
]
})
return (json_reservations, json_reservation_tooltips)

View File

@@ -67,7 +67,9 @@ var HotelCalendarView = AbstractRenderer.extend({
'phone': tp[1],
'arrival_hour': HotelCalendar.toMomentUTC(tp[2], HotelConstants.ODOO_DATETIME_MOMENT_FORMAT).local().format('HH:mm'),
'num_split': tp[3],
'amount_total': Number(tp[4]).toLocaleString()
'amount_total': Number(tp[4]).toLocaleString(),
'reservation_type': tp[5],
'out_service_description': tp[6]
};
},

View File

@@ -70,15 +70,22 @@
<t t-name="HotelCalendar.TooltipReservation">
<div class="oe_tooltip_string"><t t-esc="name"/></div>
<ul class="oe_tooltip_technical">
<li><b>Phone:</b> <t t-esc="phone"/></li>
<li><b>Arrival Hour:</b> <t t-esc="arrival_hour"/></li>
<t t-if="num_split &gt; 1">
<li><b>Splitted:</b> <t t-esc="num_split"/></li>
</t>
<!-- FIXME: HARD CURRENCY -->
<li><b>Total Amount:</b> <t t-esc="amount_total" t-widget="monetary"/></li>
</ul>
<t t-if="reservation_type == 'normal'">
<ul class="oe_tooltip_technical">
<li><b>Phone:</b> <t t-esc="phone"/></li>
<li><b>Arrival Hour:</b> <t t-esc="arrival_hour"/></li>
<t t-if="num_split &gt; 1">
<li><b>Splitted:</b> <t t-esc="num_split"/></li>
</t>
<!-- FIXME: HARD CURRENCY -->
<li><b>Total Amount:</b> <t t-esc="amount_total" t-widget="monetary"/></li>
</ul>
</t>
<t t-elif="reservation_type == 'out'">
<ul class="oe_tooltip_technical">
<li><b>Reason:</b> <t t-esc="out_service_description"/></li>
</ul>
</t>
</t>
<t t-name="HotelCalendar.TooltipRoom">