mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[WIP] Wizard Node Reservation
Create reservation from central node reviewed
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user