diff --git a/delivery_parcelhub_whistl/models/delivery.py b/delivery_parcelhub_whistl/models/delivery.py index 6eecc10..4f51e30 100644 --- a/delivery_parcelhub_whistl/models/delivery.py +++ b/delivery_parcelhub_whistl/models/delivery.py @@ -551,7 +551,7 @@ def whistl_cancel_shipment(self, pickings): ) picking.state = "cancel" - def _whistl_get_waiting_pickings(self, limit=100): + def _whistl_get_waiting_pickings(self): return self.env["stock.picking"].search( [ ("carrier_id", "=", self.id), @@ -565,20 +565,15 @@ def _whistl_get_waiting_pickings(self, limit=100): "|", ("carrier_consignment_ref", "!=", False), ("carrier_tracking_ref", "!=", False), - ], - limit=limit, # Added this to fix timeouts etc + ] ) - def whistl_tracking_state_update_scheduled(self, batch_size=100): - pickings = self._whistl_get_waiting_pickings(limit=batch_size) + def whistl_tracking_state_update_scheduled(self): + pickings = self._whistl_get_waiting_pickings() for picking in pickings: if picking.delivery_state in ["customer_delivered", "warehouse_delivered"]: continue self.whistl_tracking_state_update(picking) - if self._whistl_get_waiting_pickings(): - self.with_delay().whistl_tracking_state_update_scheduled( - batch_size=batch_size - ) def whistl_tracking_state_update(self, picking): request_url = self._get_whistl_tracking_url(