[WIP][FIX] synchronization issues

This commit is contained in:
Pablo
2019-06-04 18:38:38 +02:00
parent c5600afe1a
commit 4f62c1e60c
2 changed files with 4 additions and 6 deletions

View File

@@ -244,7 +244,7 @@ class ChannelBackend(models.Model):
@api.model
def cron_push_changes(self):
backends = self.env[self._name].search([])
backends.with_context({'force_update': True}).push_availability()
backends.push_availability()
backends.push_restriction()
backends.push_pricelist()

View File

@@ -15,13 +15,11 @@ class HotelRoomTypeAvailabilityExporter(Component):
def push_availability(self):
channel_hotel_room_type_obj = self.env['channel.hotel.room.type']
search_domain = [
channel_room_type_avail_ids = self.env['channel.hotel.room.type.availability'].search([
('backend_id', '=', self.backend_record.id),
('channel_pushed', '=', False),
('date', '>=', fields.Date.today())
]
if not self.env['channel.hotel.room.type.availability']._context.get('force_update', False):
search_domain.append(('channel_pushed', '=', False))
channel_room_type_avail_ids = self.env['channel.hotel.room.type.availability'].search(search_domain)
])
room_types = channel_room_type_avail_ids.mapped('room_type_id')
avails = []
for room_type in room_types: