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)
|
roomTypeId = fields.Integer(required=False, allow_none=True)
|
||||||
capacity = fields.Integer(required=False, allow_none=True)
|
capacity = fields.Integer(required=False, allow_none=True)
|
||||||
shortName = fields.String(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,
|
roomTypeId=room.room_type_id,
|
||||||
capacity=room.capacity,
|
capacity=room.capacity,
|
||||||
shortName=room.short_name,
|
shortName=room.short_name,
|
||||||
|
roomTypeClassId=room.room_type_id.class_id,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return result_rooms
|
return result_rooms
|
||||||
|
|||||||
@@ -29,18 +29,16 @@ class PmsUbicationService(Component):
|
|||||||
if ubication_search_param.pms_property_ids:
|
if ubication_search_param.pms_property_ids:
|
||||||
ubication = set()
|
ubication = set()
|
||||||
for index, prop in enumerate(ubication_search_param.pms_property_ids):
|
for index, prop in enumerate(ubication_search_param.pms_property_ids):
|
||||||
ubication_with_query_property = self.env[
|
ubication_with_query_property = self.env["pms.ubication"].search(
|
||||||
"pms.ubication"
|
[("pms_property_ids", "=", prop)]
|
||||||
].search([("pms_property_ids", "=", prop)])
|
)
|
||||||
if index == 0:
|
if index == 0:
|
||||||
ubication = set(ubication_with_query_property.ids)
|
ubication = set(ubication_with_query_property.ids)
|
||||||
else:
|
else:
|
||||||
ubication = ubication.intersection(
|
ubication = ubication.intersection(
|
||||||
set(ubication_with_query_property.ids)
|
set(ubication_with_query_property.ids)
|
||||||
)
|
)
|
||||||
ubication_total = list(
|
ubication_total = list(set(list(ubication) + ubication_all_properties.ids))
|
||||||
set(list(ubication) + ubication_all_properties.ids)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
ubication_total = list(ubication_all_properties.ids)
|
ubication_total = list(ubication_all_properties.ids)
|
||||||
domain = [
|
domain = [
|
||||||
|
|||||||
Reference in New Issue
Block a user