mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] pms_api_rest: amenities in room name
This commit is contained in:
committed by
Darío Lodeiros
parent
932f01f9e2
commit
82dba25023
@@ -15,3 +15,4 @@ class PmsAmenityInfo(Datamodel):
|
||||
name = fields.String(required=True, allow_none=False)
|
||||
defaultCode = fields.String(required=False, allow_none=True)
|
||||
amenityTypeId = fields.Integer(required=False, allow_none=True)
|
||||
addInRoomName = fields.Boolean(required=False, allow_none=True)
|
||||
|
||||
@@ -49,6 +49,7 @@ class PmsAmenityService(Component):
|
||||
id=amenity.id,
|
||||
name=amenity.name,
|
||||
amenityTypeId=amenity.pms_amenity_type_id.id,
|
||||
addInRoomName=amenity.is_add_code_room_name,
|
||||
)
|
||||
)
|
||||
return result_amenities
|
||||
|
||||
@@ -80,10 +80,10 @@ class PmsRoomService(Component):
|
||||
# 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
|
||||
# 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,
|
||||
|
||||
Reference in New Issue
Block a user