[IMP]pms: force room filtered by property

This commit is contained in:
Darío Lodeiros
2022-01-08 18:14:20 +01:00
parent c74199f23a
commit f76dd5481e

View File

@@ -248,7 +248,9 @@ class PmsReservationLine(models.Model):
):
if self.env.context.get("force_overbooking"):
reservation.overbooking = True
line.room_id = reservation.room_type_id.room_ids[0]
line.room_id = reservation.room_type_id.room_ids.filtered(
lambda r: r.pms_property_id == line.pms_property_id
)[0]
else:
raise ValidationError(
_("%s: No room type available")