From 1f9f4939a491fb074721c91f06c8b2911c0d40f4 Mon Sep 17 00:00:00 2001 From: braisab Date: Fri, 14 Oct 2022 10:36:25 +0200 Subject: [PATCH] [IMP]pms_api_rest: added action_cancel and confirm in reservation patch service --- pms_api_rest/services/pms_reservation_service.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pms_api_rest/services/pms_reservation_service.py b/pms_api_rest/services/pms_reservation_service.py index b2eabadc2..03d8c85c9 100644 --- a/pms_api_rest/services/pms_reservation_service.py +++ b/pms_api_rest/services/pms_reservation_service.py @@ -190,8 +190,12 @@ class PmsReservationService(Component): ) if reservation_data.toAssign is not None and not reservation_data.toAssign: reservation.action_assign() - - reservation.write(reservation_vals) + if reservation_data.stateCode == "cancel": + reservation.action_cancel() + if reservation_data.stateCode == "confirm": + reservation.confirm() + 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,