FIX When delete a product, llx_product_association rows are not deleted

This commit is contained in:
Ferran Marcet 2018-10-17 10:06:06 +02:00
parent bdae4e1c4d
commit ffde353441

View File

@ -1117,7 +1117,7 @@ class Product extends CommonObject
// Delete from product_association
if (!$error){
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association";
$sql.= " WHERE fk_product_pere = ".$this->id." OR fk_product_fils = ".$this->id;
$sql.= " WHERE fk_product_pere = ".$id." OR fk_product_fils = ".$id;
dol_syslog(get_class($this).'::delete', LOG_DEBUG);
$result = $this->db->query($sql);
if (! $result)