mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]pms: take account active reservation line in compute avail real avail
This commit is contained in:
@@ -417,12 +417,13 @@ class PmsReservationLine(models.Model):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
if avail:
|
if avail:
|
||||||
if not avail.real_avail and record.occupies_availability:
|
|
||||||
raise ValidationError(
|
|
||||||
_("There is no availability for the room type %s on %s")
|
|
||||||
% (record.room_id.room_type_id.name, record.date)
|
|
||||||
)
|
|
||||||
record.avail_id = avail.id
|
record.avail_id = avail.id
|
||||||
|
if record.occupies_availability:
|
||||||
|
if avail.real_avail < 0:
|
||||||
|
raise ValidationError(
|
||||||
|
_("There is no availability for the room type %s on %s")
|
||||||
|
% (record.room_id.room_type_id.name, record.date)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
record.avail_id = self.env["pms.availability"].create(
|
record.avail_id = self.env["pms.availability"].create(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user