FIX #12665 Mass invoice validation with stock management

Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase
or decrease the stock.
A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this
validation manually one by one.
The invoices should not be validated.
This commit is contained in:
Gérald Lelarge 2019-12-09 14:56:20 +01:00
parent e66013275d
commit 5d61e53140

View File

@ -1048,7 +1048,7 @@ if (! $error && $massaction == 'validate' && $permtocreate)
{
$objecttmp=new $objectclass($db);
if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
{
$langs->load("errors");
setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');