// Warehouse: it is not possible to delete a warehouse of it has pending supply orders.
This commit is contained in:
@@ -101,7 +101,7 @@ class AdminStockMvtControllerCore extends AdminController
|
||||
'visibility' => Shop::CONTEXT_ALL
|
||||
),
|
||||
'PS_STOCK_MVT_SUPPLY_ORDER' => array(
|
||||
'title' => $this->l('Default reason when incrementing stock when a supplier order is received:'),
|
||||
'title' => $this->l('Default reason when incrementing stock when a supply order is received:'),
|
||||
'cast' => 'intval',
|
||||
'type' => 'select',
|
||||
'list' => $reasons_inc,
|
||||
|
||||
@@ -440,6 +440,8 @@ class AdminWarehousesControllerCore extends AdminController
|
||||
return;
|
||||
else if ($obj->getQuantitiesOfProducts() > 0)
|
||||
$this->_errors[] = $this->l('It is not possible to delete a Warehosue when there are products in it.');
|
||||
else if (SupplyOrder::warehouseHasPendingOrders($obj->id))
|
||||
$this->_errors[] = $this->l('It is not possible to delete a Warehouse if it has pending supply orders.');
|
||||
else
|
||||
return parent::postProcess();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user