diff --git a/hotel_node_helper/models/inherited_hotel_room_type.py b/hotel_node_helper/models/inherited_hotel_room_type.py index b3a4c4213..0887b49c1 100644 --- a/hotel_node_helper/models/inherited_hotel_room_type.py +++ b/hotel_node_helper/models/inherited_hotel_room_type.py @@ -34,7 +34,6 @@ class HotelRoomType(models.Model): ('room_type_id', '=', room_type_id), ], ['avail']) or [{'avail': availability_real}] - # if isinstance(availability_plan, list): availability_plan = min([r['avail'] for r in availability_plan]) return min(availability_real, availability_plan) @@ -42,19 +41,16 @@ class HotelRoomType(models.Model): @api.model def get_room_type_price_unit(self, dfrom, dto, room_type_id): # TODO review how to get the prices - # price_unit = self.browse(room_type_id).list_price reservation_line_ids = self.env['hotel.reservation'].prepare_reservation_lines( dfrom, (fields.Date.from_string(dto) - fields.Date.from_string(dfrom)).days, {'room_type_id': room_type_id} ) reservation_line_ids = reservation_line_ids['reservation_line_ids'] + # QUESTION Why add [[5, 0, 0], ¿? + del reservation_line_ids[0] - price_unit = 0.0 - for x in range(1, len(reservation_line_ids)): - price_unit = price_unit + reservation_line_ids[x][2]['price'] - - return price_unit + return reservation_line_ids @api.model def get_room_type_restrictions(self, dfrom, dto, room_type_id): diff --git a/hotel_node_master/views/hotel_node.xml b/hotel_node_master/views/hotel_node.xml index bbc065ca1..b7db33479 100644 --- a/hotel_node_master/views/hotel_node.xml +++ b/hotel_node_master/views/hotel_node.xml @@ -13,6 +13,11 @@ class="oe_stat_button" icon="fa-suitcase" context="{'node_id': id}"> +