[FIX] on_record_cancel event

This commit is contained in:
Pablo
2019-03-04 09:30:14 +01:00
parent 58183fe0bd
commit 59eba7bce2
2 changed files with 3 additions and 3 deletions

View File

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

View File

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