mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]pms_api_rest: Agency without image
This commit is contained in:
@@ -8,6 +8,7 @@ class PmsCancelationRuleSearchParam(Datamodel):
|
||||
pricelistId = fields.Integer(required=False, allow_none=True)
|
||||
pmsPropertyId = fields.String(required=False, allow_none=True)
|
||||
|
||||
|
||||
class PmsCancelationRuleInfo(Datamodel):
|
||||
_name = "pms.cancelation.rule.info"
|
||||
id = fields.Integer(required=True, allow_none=False)
|
||||
|
||||
@@ -155,7 +155,7 @@ class PmsFolioService(Component):
|
||||
if reservation.agency_id
|
||||
else None,
|
||||
"agencyImage": reservation.agency_id.image_1024.decode("utf-8")
|
||||
if reservation.agency_id
|
||||
if reservation.agency_id and reservation.agency_id.image_1024
|
||||
else None,
|
||||
"state": reservation.state if reservation.state else None,
|
||||
"roomTypeCode": reservation.room_type_id.default_code
|
||||
@@ -200,7 +200,9 @@ class PmsFolioService(Component):
|
||||
if folio.payment_state
|
||||
else None,
|
||||
propertyId=folio.pms_property_id,
|
||||
agencyImage=folio.agency_id.image_1024 if folio.agency_id else None,
|
||||
agencyImage=folio.agency_id.image_1024
|
||||
if folio.agency_id and folio.agency_id.image_1024
|
||||
else None,
|
||||
)
|
||||
)
|
||||
return result_folios
|
||||
|
||||
Reference in New Issue
Block a user