// StockAvailable: updated synchronize() and updated its usage within the different stock controllers when necessary

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10331 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-11-21 11:01:33 +00:00
parent 0ce1e22813
commit 276f493dd7
8 changed files with 165 additions and 124 deletions
@@ -618,7 +618,10 @@ class AdminStockManagementControllerCore extends AdminController
$stock_manager = StockManagerFactory::getManager();
if ($stock_manager->addProduct($id_product, $id_product_attribute, $warehouse, $quantity, $id_stock_mvt_reason, $price, $usable))
{
StockAvailable::synchronize($id_product);
Tools::redirectAdmin($redirect.'&conf=1');
}
else
$this->_errors[] = Tools::displayError('An error occured. No stock was added.');
}
@@ -636,7 +639,10 @@ class AdminStockManagementControllerCore extends AdminController
$removed_products = $stock_manager->removeProduct($id_product, $id_product_attribute, $warehouse, $quantity, $id_stock_mvt_reason, $usable);
if (count($removed_products) > 0)
{
StockAvailable::synchronize($id_product);
Tools::redirectAdmin($redirect.'&conf=2');
}
else
$this->_errors[] = Tools::displayError('It is not possible to remove the specified quantity or an error occured. No stock was removed.');
}