Fix: On test le update pour valider ou non la transaction.
This commit is contained in:
parent
ad107d28e6
commit
52eecabbea
@ -126,10 +126,17 @@ class Societe {
|
|||||||
|
|
||||||
$this->creation_bit = 1;
|
$this->creation_bit = 1;
|
||||||
|
|
||||||
$result = $this->update($this->id);
|
$ret = $this->update($this->id);
|
||||||
|
|
||||||
$this->db->commit();
|
if ($ret == 0) {
|
||||||
return $result;
|
$this->db->commit();
|
||||||
|
} else {
|
||||||
|
dolibarr_syslog("Societe::create echec update");
|
||||||
|
$this->db->rollback();
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -138,7 +145,7 @@ class Societe {
|
|||||||
$this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->nom);
|
$this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->nom);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dolibarr_syslog("Societe::Create echec insert sql=$sql");
|
dolibarr_syslog("Societe::create echec insert sql=$sql");
|
||||||
}
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user