FIX Error management. Do no try to approve PO if validation fails.
This commit is contained in:
parent
0944e8b156
commit
05d82a0684
@ -854,11 +854,12 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$error++;
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step
|
// If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step
|
||||||
if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1)))
|
if (!$error && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1)))
|
||||||
{
|
{
|
||||||
$action = 'confirm_approve'; // can make standard or first level approval also if permission is set
|
$action = 'confirm_approve'; // can make standard or first level approval also if permission is set
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user