[FIX] Hot Fix set channel_pushed = False for no_ota

This Fix works because no_ota is a Boolean field. Therefore, if `no_ota` is in fields_checked it is because its value has changed from `True` to `False` or from `False` to `True`. Regardless other fields, a push_availability is mandatory
This commit is contained in:
Pablo
2019-03-28 20:18:16 +01:00
parent 8fc032aca2
commit 389621990a

View File

@@ -222,6 +222,9 @@ class BindingHotelRoomTypeAvailabilityListener(Component):
binding.backend_id.id,
room_type_id=record.room_type_id.id)
if 'no_ota' in fields_checked:
binding.write({'channel_pushed': False})
@skip_if(lambda self, record, **kwargs: self.no_connector_export(record))
def on_record_create(self, record, fields=None):
if not any(record.channel_bind_ids):
@@ -261,7 +264,7 @@ class ChannelBindingHotelRoomTypeAvailabilityListener(Component):
@skip_if(lambda self, record, **kwargs: self.no_connector_export(record))
def on_record_write(self, record, fields=None):
fields_to_check = ('date', 'channel_avail') # no_ota ¿?
fields_to_check = ('date', 'channel_avail')
fields_checked = [elm for elm in fields_to_check if elm in fields]
_logger.info("==[on_record_write] :: channel.hotel.room.type.availability==")