mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] pms_api_rest: add room type class in room service
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user