diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 20622132c00..755a503e34f 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -873,10 +873,9 @@ class CommandeFournisseur extends CommonOrder
$langs->loadLangs(['bills', 'orders']);
$datas = [];
+ $nofetch = !empty($params['nofetch']);
+
if ($user->hasRight("fournisseur", "commande", "read")) {
- if (!is_object($this->thirdparty)) {
- $this->fetch_thirdparty();
- }
$datas['picto'] = ''.$langs->trans("SupplierOrder").'';
if (isset($this->statut)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
@@ -887,8 +886,12 @@ class CommandeFournisseur extends CommonOrder
if (!empty($this->ref_supplier)) {
$datas['refsupplier'] = '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier;
}
- if (!empty($this->thirdparty->name)) {
- $datas['suppliername'] = '
'.$langs->trans('Supplier').': '.$this->thirdparty->name;
+ if (!$nofetch) {
+ $langs->load('companies');
+ if (empty($this->thirdparty)) {
+ $this->fetch_thirdparty();
+ }
+ $datas['supplier'] = '
'.$langs->trans('Supplier').': '.$this->thirdparty->getNomUrl(1, '', 0, 1);
}
if (!empty($this->total_ht)) {
$datas['totalht'] = '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);