Merge pull request #25986 from thomas-Ngr/14.0_fix_commandefourn_delete_row
FIX : Can't delete a fourn commande row if a commande ligne is linked
This commit is contained in:
commit
c2b9ea2192
1 changed files with 9 additions and 2 deletions
|
|
@ -3892,10 +3892,17 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||
return -1;
|
||||
}
|
||||
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".((int) $this->id);
|
||||
$sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE rowid=".((int) $this->id);
|
||||
$resql = $this->db->query($sql1);
|
||||
if (!$resql) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql2 = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".((int) $this->id);
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
$resql = $this->db->query($sql2);
|
||||
if ($resql) {
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
|
|
|
|||
Loading…
Reference in a new issue