From 957655d0719e11e8e56cfb7dcb5a7b50647eea9d Mon Sep 17 00:00:00 2001 From: Dario Lodeiros Date: Wed, 5 Jun 2019 15:10:47 +0200 Subject: [PATCH] [FIX] ensure_one cancel reservation --- .../models/hotel_reservation/importer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hotel_channel_connector_wubook/models/hotel_reservation/importer.py b/hotel_channel_connector_wubook/models/hotel_reservation/importer.py index 06d23ba12..4696b43a8 100644 --- a/hotel_channel_connector_wubook/models/hotel_reservation/importer.py +++ b/hotel_channel_connector_wubook/models/hotel_reservation/importer.py @@ -401,10 +401,11 @@ class HotelReservationImporter(Component): if reservations: new_books, old_reservations = self.wubook_modification(reservations, book) if old_reservations: - old_reservations.odoo_id.with_context({ - 'connector_no_export': True, - 'ota_limits': False, - 'no_penalty': True}).action_cancel() + for res in old_reservations: + res.odoo_id.with_context({ + 'connector_no_export': True, + 'ota_limits': False, + 'no_penalty': True}).action_cancel() if len(new_books) == 0: processed_rids.append(rcode) continue