From 805ae2d3c6c60e85fe439243243071b52156b4b2 Mon Sep 17 00:00:00 2001 From: Dario Lodeiros Date: Tue, 12 Mar 2019 16:53:34 +0100 Subject: [PATCH] [WIP] Payments Notifications --- .../models/hotel_reservation/common.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hotel_channel_connector_wubook/models/hotel_reservation/common.py b/hotel_channel_connector_wubook/models/hotel_reservation/common.py index 2df0ae844..9301edf57 100644 --- a/hotel_channel_connector_wubook/models/hotel_reservation/common.py +++ b/hotel_channel_connector_wubook/models/hotel_reservation/common.py @@ -60,7 +60,18 @@ class HotelReservation(models.Model): if user.has_group('hotel.group_hotel_call'): self.write({'to_assign': True}) +<<<<<<< b9c294db6ea8fe0ebb7998209a7a905c3c240082 return super(HotelReservation, self).action_cancel() +======= + res = super(HotelReservation, self).action_cancel() + for record in self: + # Only can cancel reservations created directly in wubook + for binding in record.channel_bind_ids: + if binding.external_id and not binding.ota_id and \ + int(binding.channel_status) in WUBOOK_STATUS_GOOD: + self.sudo().env['channel.hotel.reservation']._event('on_record_cancel').notify(binding) + return res +>>>>>>> [WIP] Payments Notifications @api.multi def confirm(self):