[TMP]: add amenity code in room short name

This commit is contained in:
Darío Lodeiros
2022-12-07 11:56:50 +01:00
parent c2b68ac115
commit 6b02d13402

View File

@@ -77,14 +77,20 @@ class PmsRoomService(Component):
) )
.sorted("sequence") .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( result_rooms.append(
PmsRoomInfo( PmsRoomInfo(
id=room.id, id=room.id,
name=room.name, name=room.display_name,
roomTypeId=room.room_type_id, roomTypeId=room.room_type_id,
capacity=room.capacity, capacity=room.capacity,
shortName=room.short_name, shortName=short_name,
roomTypeClassId=room.room_type_id.class_id, roomTypeClassId=room.room_type_id.class_id,
ubicationId=room.ubication_id, ubicationId=room.ubication_id,
extraBedsAllowed=room.extra_beds_allowed, extraBedsAllowed=room.extra_beds_allowed,