2
0
forked from Wavyzz/dolibarr

Fix: error message was not enough to understand

Conflicts:
	htdocs/langs/en_US/errors.lang
This commit is contained in:
Laurent Destailleur
2016-06-24 17:04:59 +02:00
parent f6119cfee8
commit 1368e6d462
5 changed files with 21 additions and 7 deletions

View File

@@ -1242,7 +1242,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;
@@ -2563,7 +2564,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']);