mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms: force room filtered by property
This commit is contained in:
@@ -248,7 +248,9 @@ class PmsReservationLine(models.Model):
|
|||||||
):
|
):
|
||||||
if self.env.context.get("force_overbooking"):
|
if self.env.context.get("force_overbooking"):
|
||||||
reservation.overbooking = True
|
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:
|
else:
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
_("%s: No room type available")
|
_("%s: No room type available")
|
||||||
|
|||||||
Reference in New Issue
Block a user