StockAvailable::setQuantity((int)$product->id, 0, $product->quantity, Context::getContext()->shop->id)
That code line sets the "quantity" to 0 in each product created. Is it totally necessary?
My own script seems to work fine without this line
(commented)--> //StockAvailable::setQuantity((int)$product->id, 0, $product->quantity, Context::getContext()->shop->id)
thanks.
edition:
OK I'm sorry, the code works fine in a INSERT new product, but dont't work in my script in a UPDATE product.
thanks.