mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]14.0-pms_api_rest: added blocked field in reservation datamodel
This commit is contained in:
@@ -30,6 +30,7 @@ class PmsReservationShortInfo(Datamodel):
|
||||
numServices = fields.Integer(required=False, allow_none=True)
|
||||
toAssign = fields.Boolean(required=False, allow_none=True)
|
||||
overbooking = fields.Boolean(required=False, allow_none=True)
|
||||
isBlocked = fields.Boolean(required=False, allow_none=True)
|
||||
|
||||
|
||||
class PmsReservationInfo(Datamodel):
|
||||
@@ -92,6 +93,7 @@ class PmsReservationInfo(Datamodel):
|
||||
nights = fields.Integer(required=False, allow_none=True)
|
||||
isReselling = fields.Boolean(required=False, allow_none=True)
|
||||
createdBy = fields.String(required=False, allow_none=True)
|
||||
isBlocked = fields.Boolean(required=False, allow_none=True)
|
||||
|
||||
# TODO: Refact
|
||||
# messages = fields.List(fields.Dict(required=False, allow_none=True))
|
||||
|
||||
@@ -308,6 +308,7 @@ class PmsFolioService(Component):
|
||||
line.is_reselling
|
||||
for line in reservation.reservation_line_ids
|
||||
),
|
||||
"isBlocked": reservation.blocked
|
||||
}
|
||||
)
|
||||
result_folios.append(
|
||||
@@ -559,6 +560,7 @@ class PmsFolioService(Component):
|
||||
else 0,
|
||||
toAssign=reservation.to_assign,
|
||||
overbooking=reservation.overbooking,
|
||||
isBlocked=reservation.blocked
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ class PmsReservationService(Component):
|
||||
isReselling=any(
|
||||
line.is_reselling for line in reservation.reservation_line_ids
|
||||
),
|
||||
|
||||
isBlocked=reservation.blocked,
|
||||
)
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user