mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Avoid splitted reservation in intemediate calculation room lines
This commit is contained in:
@@ -1123,7 +1123,7 @@ class PmsReservation(models.Model):
|
||||
# REVIEW: Updating preferred_room_id here avoids cyclical dependency
|
||||
for reservation in self:
|
||||
room_ids = reservation.reservation_line_ids.mapped("room_id.id")
|
||||
if len(room_ids) > 1:
|
||||
if len(room_ids) > 1 and not self._context.get("not_split"):
|
||||
reservation.splitted = True
|
||||
reservation.preferred_room_id = False
|
||||
else:
|
||||
|
||||
@@ -199,7 +199,9 @@ class PmsReservationLine(models.Model):
|
||||
manual_assigned = True
|
||||
# if there is availability for the entire stay
|
||||
if rooms_available:
|
||||
|
||||
# Avoid that reservation._compute_splitted set the
|
||||
# reservation like splitted in intermediate calculations
|
||||
reservation = reservation.with_context(not_split=True)
|
||||
# if the reservation has a preferred room
|
||||
if reservation.preferred_room_id:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user