Fix: error message was not enough to understand

This commit is contained in:
Laurent Destailleur
2016-06-24 17:04:59 +02:00
parent 2767df2e01
commit f97b67db6b
5 changed files with 18 additions and 7 deletions

View File

@@ -1278,7 +1278,8 @@ class Commande extends CommonOrder
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough');
$langs->load("errors");
$this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref);
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
$this->db->rollback();
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
@@ -2642,7 +2643,8 @@ class Commande extends CommonOrder
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough');
$langs->load("errors");
$this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref);
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
$this->db->rollback();
unset($_POST['productid']);