mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD] Show out of service reason
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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]
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -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 > 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 > 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">
|
||||
|
||||
Reference in New Issue
Block a user