From 32ca815a0a5747b4df891274548332d0694ce543 Mon Sep 17 00:00:00 2001 From: miguelpadin Date: Mon, 28 Nov 2022 13:49:24 +0100 Subject: [PATCH] [FIX] pms-api-rest: remove services when no board service @ udpate reservation service --- pms_api_rest/services/pms_reservation_service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pms_api_rest/services/pms_reservation_service.py b/pms_api_rest/services/pms_reservation_service.py index 25af0fd39..d1cad6148 100644 --- a/pms_api_rest/services/pms_reservation_service.py +++ b/pms_api_rest/services/pms_reservation_service.py @@ -206,9 +206,12 @@ class PmsReservationService(Component): reservation_vals = self._create_vals_from_params( reservation_vals, reservation_data ) + if reservation_data.boardServiceId == 0: + reservation.service_ids.filtered(lambda x: x.is_board_service).unlink() if reservation_vals: reservation.write(reservation_vals) + def _get_reservation_lines_mapped(self, origin_data, reservation_line=False): # Return dict witch reservation.lines values (only modified if line exist, # or all pass values if line not exist)