From 6b02d13402c9b8a2a6924f0d6e6acd45e5e9da0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Wed, 7 Dec 2022 11:56:50 +0100 Subject: [PATCH] [TMP]: add amenity code in room short name --- pms_api_rest/services/pms_room_service.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pms_api_rest/services/pms_room_service.py b/pms_api_rest/services/pms_room_service.py index 4bd253d0a..702c75366 100644 --- a/pms_api_rest/services/pms_room_service.py +++ b/pms_api_rest/services/pms_room_service.py @@ -77,14 +77,20 @@ class PmsRoomService(Component): ) .sorted("sequence") ): - + # TODO: avoid, change short_name, + # set code amenities like a tag in room calendar name? + short_name = room.short_name + if room.room_amenity_ids: + for amenity in room.room_amenity_ids: + if amenity.is_add_code_room_name: + short_name += "%s" % amenity.default_code result_rooms.append( PmsRoomInfo( id=room.id, - name=room.name, + name=room.display_name, roomTypeId=room.room_type_id, capacity=room.capacity, - shortName=room.short_name, + shortName=short_name, roomTypeClassId=room.room_type_id.class_id, ubicationId=room.ubication_id, extraBedsAllowed=room.extra_beds_allowed,