mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Set to_assign to False when preferred_room_id is manually set
This commit is contained in:
@@ -173,6 +173,17 @@ class PmsReservationLine(models.Model):
|
||||
and not line.room_id
|
||||
):
|
||||
free_room_select = True if reservation.preferred_room_id else False
|
||||
|
||||
# Check if the room assigment is manual or automatic to set the
|
||||
# to_assign value on reservation
|
||||
if (
|
||||
free_room_select
|
||||
and reservation.preferred_room_id.id
|
||||
not in reservation.reservation_line_ids.room_id.ids
|
||||
):
|
||||
# This case is a preferred_room_id manually assigned
|
||||
reservation.to_assign = False
|
||||
|
||||
# we get the rooms available for the entire stay
|
||||
rooms_available = self.env["pms.availability.plan"].rooms_available(
|
||||
checkin=line.reservation_id.checkin,
|
||||
|
||||
Reference in New Issue
Block a user