title: Not able to change stock quanitity
body: <p>I'm trying to adjust the stock of a product with Mage. But for some reason all my changes are ignored and I don't get an errormessage at all.</p>
  
  <p>I already did a lot of research on google and ended with this code snipped if found here (<a href="https://stackoverflow.com/questions/11139516/cannot-update-stock-item-quantity-for-a-product-in-magento-1-6-2">Cannot update Stock Item Quantity for a Product in Magento 1.6.2</a>).</p>
  
  <pre><code>$product = Mage::getModel('catalog/product')-&gt;loadByAttribute('sku', "test_7");
  
  
  
                 $stockData = $product-&gt;getStockItem();
                 printf(PHP_EOL.'Stock: qty=%d, instock=%s, man_stock=%s, use_cfg_man_stock=%s'.PHP_EOL,
                 $stockData-&gt;getData('qty'),
                 $stockData-&gt;getData('is_in_stock'),
                 $stockData-&gt;getData('manage_stock'),
                 $stockData-&gt;getData('use_config_manage_stock')
                 );
                 // prints out qty=0, instock=, man_stock=, use_cfg_man_stock=
  
  
                 // $stockQty = 1
                 $stockItem = Mage::getModel('cataloginventory/stock_item');
                 $stockItem-&gt;assignProduct($product);
                 $stockItem-&gt;setData('is_in_stock', 1);
                 $stockItem-&gt;setData('stock_id', 1);
                 $stockItem-&gt;setData('store_id', 1);
                 $stockItem-&gt;setData('manage_stock', 0);
                 $stockItem-&gt;setData('use_config_manage_stock', 0);
                 $stockItem-&gt;setData('min_sale_qty', 0);
                 $stockItem-&gt;setData('use_config_min_sale_qty', 0);
                 $stockItem-&gt;setData('max_sale_qty', 1000);
                 $stockItem-&gt;setData('use_config_max_sale_qty', 0);
                 $stockItem-&gt;setData('qty', $stockQty);
                 $stockItem-&gt;save();
  
                 $product-&gt;save();
                 $product-&gt;load();
                 $stockData = $product-&gt;getStockItem();
                 printf('New Stock: qty=%d, instock=%s, man_stock=%s, use_cfg_man_stock=%s'.PHP_EOL,
                 $stockData-&gt;getData('qty'),
                 $stockData-&gt;getData('is_in_stock'),
                 $stockData-&gt;getData('manage_stock'),
                 $stockData-&gt;getData('use_config_manage_stock')
                 );
  </code></pre>
  
  <p>But for some reason, the response is still:</p>
  
  <blockquote>
    <p>Stock: qty=0, instock=, man_stock=, use_cfg_man_stock= New Stock:
    qty=0, instock=1, man_stock=0, use_cfg_man_stock=0</p>
  </blockquote>
  
  <p>Does anyone have an idea what could be wrong?</p>