[FIX] pms-pwa: add amenity in room name as a field in calendar service

This commit is contained in:
miguelpadin
2023-07-13 11:56:22 +02:00
committed by Darío Lodeiros
parent 913391f592
commit 8a819cb675
2 changed files with 3 additions and 0 deletions

View File

@@ -24,3 +24,4 @@ class PmsRoomInfo(Datamodel):
ubicationId = fields.Integer(required=False, allow_none=True)
extraBedsAllowed = fields.Integer(required=False, allow_none=True)
roomAmenityIds = fields.List(fields.Integer(), required=False, allow_none=True)
roomAmenityInName = fields.String(required=False, allow_none=True)

View File

@@ -97,6 +97,8 @@ class PmsRoomService(Component):
roomAmenityIds=room.room_amenity_ids.ids
if room.room_amenity_ids
else None,
roomAmenityInName=room.room_amenity_ids.filtered(lambda x: x.is_add_code_room_name).name if
room.room_amenity_ids.filtered(lambda x: x.is_add_code_room_name).name else ''
)
)
return result_rooms