From 59eba7bce24bd21701138ed41fe20e14e6cfdec1 Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 4 Mar 2019 09:30:14 +0100 Subject: [PATCH] [FIX] on_record_cancel event --- .../models/hotel_reservation/common.py | 4 ++-- .../models/hotel_reservation/exporter.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hotel_channel_connector_wubook/models/hotel_reservation/common.py b/hotel_channel_connector_wubook/models/hotel_reservation/common.py index 1ef3e3708..fa945e398 100644 --- a/hotel_channel_connector_wubook/models/hotel_reservation/common.py +++ b/hotel_channel_connector_wubook/models/hotel_reservation/common.py @@ -46,8 +46,8 @@ class HotelReservation(models.Model): # 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 \ - binding.channel_status in WUBOOK_STATUS_GOOD: - self._event('on_record_cancel').notify(binding) + int(binding.channel_status) in WUBOOK_STATUS_GOOD: + self.env['channel.hotel.reservation']._event('on_record_cancel').notify(binding) return res @api.multi diff --git a/hotel_channel_connector_wubook/models/hotel_reservation/exporter.py b/hotel_channel_connector_wubook/models/hotel_reservation/exporter.py index 5250dee49..a81d6494f 100644 --- a/hotel_channel_connector_wubook/models/hotel_reservation/exporter.py +++ b/hotel_channel_connector_wubook/models/hotel_reservation/exporter.py @@ -10,7 +10,7 @@ class HotelReservationExporter(Component): @api.model def cancel_reservation(self, binding): - user = self.env['res.user'].browse(self.env.uid) + user = self.env['res.users'].browse(self.env.uid) try: binding.with_context({ 'connector_no_export': True,