forked from Wavyzz/dolibarr
Merge pull request #13726 from simicar29/11.0-supplierproposal
Clean line extrafields when deleting supplier proposal
This commit is contained in:
@@ -2061,11 +2061,14 @@ class SupplierProposal extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$main = MAIN_DB_PREFIX . 'supplier_proposaldet';
|
||||
$ef = $main . "_extrafields";
|
||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_supplier_proposal = " . $this->id . ")";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE fk_supplier_proposal = ".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposal WHERE rowid = ".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
if ($this->db->query($sqlef) && $this->db->query($sql))
|
||||
{
|
||||
// Delete linked object
|
||||
$res = $this->deleteObjectLinked();
|
||||
|
||||
Reference in New Issue
Block a user