Fix: Avoid validate twice

This commit is contained in:
Laurent Destailleur 2008-05-18 11:58:35 +00:00
parent 53d1a13266
commit 01c894e7d8

View File

@ -205,8 +205,17 @@ class Commande extends CommonObject
{ {
global $conf,$langs; global $conf,$langs;
if ($user->rights->commande->valider) if ($this->statut == 1)
{ {
return 0;
}
if (! $this->$user->rights->commande->valider)
{
$this->error='Autorisation insuffisante';
return -1;
}
$this->db->begin(); $this->db->begin();
// Definition du nom de module de numerotation de commande // Definition du nom de module de numerotation de commande
@ -313,10 +322,6 @@ class Commande extends CommonObject
} }
} }
$this->error='Autorisation insuffisante';
return -1;
}
/** /**
* \brief Set draft status * \brief Set draft status
* \param user Object user that modify * \param user Object user that modify