FIX : test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
This commit is contained in:
parent
7de812d2ed
commit
4c3f9d6d5e
@ -186,13 +186,17 @@ if (empty($reshook))
|
||||
$qualified_for_stock_change = $object->hasProductsOrServices(1);
|
||||
}
|
||||
|
||||
$result = $object->delete($user, 0, $idwarehouse);
|
||||
if ($result > 0) {
|
||||
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
|
||||
exit();
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
if($object->is_erasable()) {
|
||||
|
||||
$result = $object->delete($user, 0, $idwarehouse);
|
||||
if ($result > 0) {
|
||||
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
|
||||
exit();
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user