[IMP] pms_api_rest: show reservation when property isn't specified in url

This commit is contained in:
Sara Lago
2022-02-04 11:26:32 +01:00
committed by Darío Lodeiros
parent 3f97281dc4
commit a986b095c9

View File

@@ -27,7 +27,8 @@ class PmsReservationService(Component):
def get_reservation(self, reservation_id, pms_search_param):
domain = list()
domain.append(("id", "=", reservation_id))
domain.append(("pms_property_id", "=", pms_search_param.pms_property_id))
if pms_search_param.pms_property_id:
domain.append(("pms_property_id", "=", pms_search_param.pms_property_id))
reservation = self.env["pms.reservation"].search(domain)
res = []
PmsReservationInfo = self.env.datamodels["pms.reservation.info"]