mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] on_record_cancel event
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user