diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cf013497aec..807c5f37bfc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5213,14 +5213,10 @@ abstract class CommonObject $discount->fk_soc = $this->socid; $this->tpl['label'] .= $discount->getNomUrl(0, 'discount'); } elseif (!empty($line->fk_product)) { - $productstatic = new Product($this->db); - $productstatic->id = $line->fk_product; - $productstatic->ref = $line->ref; - $productstatic->type = $line->fk_product_type; - if (empty($productstatic->ref)) { + if (empty($line->product)) { $line->fetch_product(); - $productstatic = $line->product; } + $productstatic = $line->product; $this->tpl['label'] .= $productstatic->getNomUrl(1); $this->tpl['label'] .= ' - '.(!empty($line->label) ? $line->label : $line->product_label);