mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] add only __mapped__ board services
This commit is contained in:
@@ -18,11 +18,12 @@ class HotelRoomTypeExporter(Component):
|
|||||||
# TODO: do not write if backend_adapter.modify_room through an error
|
# TODO: do not write if backend_adapter.modify_room through an error
|
||||||
boards = {}
|
boards = {}
|
||||||
for board in binding.board_service_room_type_ids:
|
for board in binding.board_service_room_type_ids:
|
||||||
boards.update(
|
if board.channel_service:
|
||||||
{board.channel_service: {
|
boards.update(
|
||||||
'dtype': 2 if board.price_type == 'fixed' else 1,
|
{board.channel_service: {
|
||||||
'value': board.amount}}
|
'dtype': 2 if board.price_type == 'fixed' else 1,
|
||||||
)
|
'value': board.amount}}
|
||||||
|
) and board.channel_service
|
||||||
return self.backend_adapter.modify_room(
|
return self.backend_adapter.modify_room(
|
||||||
binding.external_id,
|
binding.external_id,
|
||||||
binding.name,
|
binding.name,
|
||||||
@@ -52,11 +53,12 @@ class HotelRoomTypeExporter(Component):
|
|||||||
try:
|
try:
|
||||||
boards = {}
|
boards = {}
|
||||||
for board in binding.board_service_room_type_ids:
|
for board in binding.board_service_room_type_ids:
|
||||||
boards.update(
|
if board.channel_service:
|
||||||
{board.channel_service: {
|
boards.update(
|
||||||
'dtype': 2 if board.price_type == 'fixed' else 1,
|
{board.channel_service: {
|
||||||
'value': board.amount}}
|
'dtype': 2 if board.price_type == 'fixed' else 1,
|
||||||
)
|
'value': board.amount}}
|
||||||
|
) and board.channel_service
|
||||||
external_id = self.backend_adapter.create_room(
|
external_id = self.backend_adapter.create_room(
|
||||||
short_code,
|
short_code,
|
||||||
binding.name,
|
binding.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user