diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6eff20da863..18495a68f50 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2195,9 +2195,7 @@ class Commande extends CommonOrder $line->fetch($lineid); // Memorize previous line for triggers - $staticline=new OrderLine($this->db); - $staticline->fetch($lineid); - $staticline->fetch_optionals($lineid); + $staticline = clone $line; $line->oldline = $staticline; if ($line->delete($user) > 0) @@ -3054,7 +3052,7 @@ class Commande extends CommonOrder } $this->line->rowid=$rowid; - $this->line->label=$label; + $this->line->label=!empty($label)?$label:$this->line->oldline->label; $this->line->desc=$desc; $this->line->qty=$qty;