I'm trying to remove all the Stock from query products in a cronjob:
List<ProductModel> products = flexibleSearchService.search(GET_SPECIAL_PRODUCTS_QUERY);
for (ProductModel product : products.getResult()) {
modelService.removeAll(product.getStockLevels());
}
If I debug here I can see that all the products have stock, however, after performing the removeAll method from model Service, the Stock is not removed.
How can I fix this?