From 24cb739b7c78685327aaea793bb1f560f73e3d18 Mon Sep 17 00:00:00 2001 From: Norbert Penel Date: Mon, 20 Jan 2020 18:54:35 +0100 Subject: [PATCH] FIX : multicompany, impossible to add second task due to ref already exists, it was impossible to add a second task on company > 1 this need to be fixed in all Dolibarr versions All datas with more than 1 company are corrupted ! --- htdocs/projet/class/task.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 60657b08061..2fcb012f3c4 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -156,6 +156,7 @@ class Task extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task ("; $sql .= "fk_projet"; $sql .= ", ref"; + $sql.= ", entity"; $sql .= ", fk_task_parent"; $sql .= ", label"; $sql .= ", description"; @@ -168,6 +169,7 @@ class Task extends CommonObject $sql .= ") VALUES ("; $sql .= $this->fk_project; $sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null'); + $sql.= ", ".$conf->entity; $sql .= ", ".$this->fk_task_parent; $sql .= ", '".$this->db->escape($this->label)."'"; $sql .= ", '".$this->db->escape($this->description)."'";