[IMP] pms_api_rest: add room type class in room service

This commit is contained in:
Sara
2022-05-18 16:37:53 +02:00
committed by Darío Lodeiros
parent 7955d07c24
commit f02ac4c50c
3 changed files with 6 additions and 6 deletions

View File

@@ -17,3 +17,4 @@ class PmsRoomInfo(Datamodel):
roomTypeId = fields.Integer(required=False, allow_none=True)
capacity = fields.Integer(required=False, allow_none=True)
shortName = fields.String(required=False, allow_none=True)
roomTypeClassId = fields.Integer(required=False, allow_none=True)

View File

@@ -51,6 +51,7 @@ class PmsRoomService(Component):
roomTypeId=room.room_type_id,
capacity=room.capacity,
shortName=room.short_name,
roomTypeClassId=room.room_type_id.class_id,
)
)
return result_rooms

View File

@@ -29,18 +29,16 @@ class PmsUbicationService(Component):
if ubication_search_param.pms_property_ids:
ubication = set()
for index, prop in enumerate(ubication_search_param.pms_property_ids):
ubication_with_query_property = self.env[
"pms.ubication"
].search([("pms_property_ids", "=", prop)])
ubication_with_query_property = self.env["pms.ubication"].search(
[("pms_property_ids", "=", prop)]
)
if index == 0:
ubication = set(ubication_with_query_property.ids)
else:
ubication = ubication.intersection(
set(ubication_with_query_property.ids)
)
ubication_total = list(
set(list(ubication) + ubication_all_properties.ids)
)
ubication_total = list(set(list(ubication) + ubication_all_properties.ids))
else:
ubication_total = list(ubication_all_properties.ids)
domain = [