From 0d8e2a1bf065062f12c03edc257c94b21c3ac6d1 Mon Sep 17 00:00:00 2001 From: Pablo Date: Tue, 19 Feb 2019 10:20:57 +0100 Subject: [PATCH] [FIX] add only __mapped__ board services --- .../models/hotel_room_type/exporter.py | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/hotel_channel_connector_wubook/models/hotel_room_type/exporter.py b/hotel_channel_connector_wubook/models/hotel_room_type/exporter.py index 7a9c1e76d..9131fb5d5 100644 --- a/hotel_channel_connector_wubook/models/hotel_room_type/exporter.py +++ b/hotel_channel_connector_wubook/models/hotel_room_type/exporter.py @@ -18,11 +18,12 @@ class HotelRoomTypeExporter(Component): # TODO: do not write if backend_adapter.modify_room through an error boards = {} for board in binding.board_service_room_type_ids: - boards.update( - {board.channel_service: { - 'dtype': 2 if board.price_type == 'fixed' else 1, - 'value': board.amount}} - ) + if board.channel_service: + boards.update( + {board.channel_service: { + 'dtype': 2 if board.price_type == 'fixed' else 1, + 'value': board.amount}} + ) and board.channel_service return self.backend_adapter.modify_room( binding.external_id, binding.name, @@ -52,11 +53,12 @@ class HotelRoomTypeExporter(Component): try: boards = {} for board in binding.board_service_room_type_ids: - boards.update( - {board.channel_service: { - 'dtype': 2 if board.price_type == 'fixed' else 1, - 'value': board.amount}} - ) + if board.channel_service: + boards.update( + {board.channel_service: { + 'dtype': 2 if board.price_type == 'fixed' else 1, + 'value': board.amount}} + ) and board.channel_service external_id = self.backend_adapter.create_room( short_code, binding.name,