[FIX] add only __mapped__ board services

This commit is contained in:
Pablo
2019-02-19 10:20:57 +01:00
committed by Dario Lodeiros
parent b385ec338d
commit 0d8e2a1bf0

View File

@@ -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,