Fix other reports
This commit is contained in:
parent
75e066933a
commit
c202ba6ca8
19
booking.py
19
booking.py
|
@ -1479,9 +1479,24 @@ class GuestsListReport(Report):
|
|||
rooms = Room.search_read([])
|
||||
|
||||
_rooms_occupied = len(set(rooms_occupied))
|
||||
occupancy_rate = round(_rooms_occupied / len(rooms), 2)
|
||||
num_rooms = len(rooms)
|
||||
if num_rooms:
|
||||
occupancy_rate = round(_rooms_occupied / num_rooms, 2)
|
||||
else:
|
||||
occupancy_rate = 0
|
||||
print('operations ...', operations)
|
||||
report_context['records'] = operations
|
||||
operations_ = []
|
||||
for op in operations:
|
||||
for guest in op.guests:
|
||||
operations_.append({
|
||||
'room': op.room.code,
|
||||
'guest': guest.party.name,
|
||||
'party': op.party.code,
|
||||
'start_date': op.start_date,
|
||||
'end_date': op.end_date,
|
||||
'nights_quantity': op.nights_quantity,
|
||||
})
|
||||
report_context['records'] = operations_
|
||||
report_context['total_rooms'] = _rooms_occupied
|
||||
report_context['total_guests'] = sum(total_guests)
|
||||
report_context['occupancy_rate'] = occupancy_rate
|
||||
|
|
|
@ -280,7 +280,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="name">Rooms Occupancy Report</field>
|
||||
<field name="model"></field>
|
||||
<field name="report_name">hotel.rooms_occupancy.report</field>
|
||||
<field name="report">hotel/rooms_occupancy.ods</field>
|
||||
<field name="report">hotel/rooms_occupancy.fods</field>
|
||||
<field name="template_extension">ods</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="print_rooms_occupancy_start_view_form">
|
||||
|
@ -299,7 +299,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="name">Booking Forecast Report</field>
|
||||
<field name="model"></field>
|
||||
<field name="report_name">hotel.booking_forecast.report</field>
|
||||
<field name="report">hotel/booking_forecast.ods</field>
|
||||
<field name="report">hotel/booking_forecast.fods</field>
|
||||
<field name="template_extension">ods</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="print_booking_forecast_start_view_form">
|
||||
|
@ -331,7 +331,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="name">Guests List Report</field>
|
||||
<field name="model"></field>
|
||||
<field name="report_name">hotel.guests_list.report</field>
|
||||
<field name="report">hotel/guests_list.ods</field>
|
||||
<field name="report">hotel/guests_list.fods</field>
|
||||
<field name="template_extension">ods</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="print_guests_list_start_view_form">
|
||||
|
@ -356,7 +356,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="name">Booking Daily Report</field>
|
||||
<field name="model"></field>
|
||||
<field name="report_name">hotel.booking_daily.report</field>
|
||||
<field name="report">hotel/booking_daily.ods</field>
|
||||
<field name="report">hotel/booking_daily.fods</field>
|
||||
<field name="template_extension">ods</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="print_booking_daily_start_view_form">
|
||||
|
|
BIN
guests_list.fods
BIN
guests_list.fods
Binary file not shown.
|
@ -170,7 +170,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="name">Migration Report</field>
|
||||
<field name="model"></field>
|
||||
<field name="report_name">hotel.migration</field>
|
||||
<field name="report">hotel/migration_report.ods</field>
|
||||
<field name="report">hotel/migration_report.fods</field>
|
||||
<field name="template_extension">ods</field>
|
||||
</record>
|
||||
<menuitem name="Migration Report" sequence="60" parent="menu_reporting"
|
||||
|
|
Loading…
Reference in New Issue