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