mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] pms_api_rest: filter room service by property
This commit is contained in:
committed by
Darío Lodeiros
parent
86056dd6fc
commit
8a2e94ed24
@@ -7,3 +7,4 @@ class PmsRoomSearchParam(Datamodel):
|
||||
_name = "pms.room.search.param"
|
||||
id = fields.Integer(required=False, allow_none=True)
|
||||
name = fields.String(required=False, allow_none=True)
|
||||
pms_property_id = fields.Integer(required=False, allow_none=True)
|
||||
|
||||
@@ -28,6 +28,9 @@ class PmsRoomService(Component):
|
||||
domain.append(("name", "like", room_search_param.name))
|
||||
if room_search_param.id:
|
||||
domain.append(("id", "=", room_search_param.id))
|
||||
if room_search_param.pms_property_id:
|
||||
domain.append(("pms_property_id", "=", room_search_param.pms_property_id))
|
||||
|
||||
result_rooms = []
|
||||
PmsRoomInfo = self.env.datamodels["pms.room.info"]
|
||||
for room in (
|
||||
|
||||
Reference in New Issue
Block a user