Fix: problem to delete a service if the product module is disable
This commit is contained in:
parent
27005362b3
commit
b523ab815a
@ -572,6 +572,7 @@ class Product extends CommonObject
|
||||
function delete($id)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
if ($user->rights->produit->supprimer)
|
||||
|
||||
@ -343,11 +343,15 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->produit->
|
||||
/*
|
||||
* Suppression d'un produit/service pas encore affect
|
||||
*/
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->produit->supprimer)
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes')
|
||||
{
|
||||
$product = new Product($db);
|
||||
$product->fetch($id);
|
||||
$result = $product->delete($id);
|
||||
|
||||
if ( ($product->type == 0 && $user->rights->produit->supprimer) || ($product->type == 1 && $user->rights->service->supprimer) )
|
||||
{
|
||||
$result = $product->delete($id);
|
||||
}
|
||||
|
||||
if ($result == 0)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user