Clean line extrafields when deleting contrat
This commit is contained in:
parent
6819255b76
commit
a70be95760
@ -1234,6 +1234,22 @@ class Contrat extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$error)
|
||||||
|
{
|
||||||
|
// Delete contratdet extrafields
|
||||||
|
$main = MAIN_DB_PREFIX . 'contratdet';
|
||||||
|
$ef = $main . "_extrafields";
|
||||||
|
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_contrat = " . $this->id . ")";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::delete contratdet_extrafields", LOG_DEBUG);
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (!$resql)
|
||||||
|
{
|
||||||
|
$this->error = $this->db->error();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Delete contratdet
|
// Delete contratdet
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user