diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 2abe2007175..61d422b83d1 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -708,6 +708,10 @@ class Entrepot extends CommonObject
$langs->load('stocks');
$datas = [];
+
+ $option = $params['option'] ?? '';
+ $nofetch = !empty($params['nofetch']);
+
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
return ['optimize' => $langs->trans("Warehouse")];
}
@@ -719,6 +723,12 @@ class Entrepot extends CommonObject
if (!empty($this->lieu)) {
$datas['locationsummary'] = '
'.$langs->trans('LocationSummary').': '.$this->lieu;
}
+ // show categories for this record only in ajax to not overload lists
+ if (!$nofetch && isModEnabled('categorie')) {
+ require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
+ $form = new Form($this->db);
+ $datas['categories_warehouse'] = '
' . $form->showCategories($this->id, Categorie::TYPE_WAREHOUSE, 1, 1);
+ }
return $datas;
}
@@ -752,13 +762,14 @@ class Entrepot extends CommonObject
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
+ 'nofetch' => 1,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$classfortooltip = 'classforajaxtooltip';
$dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"';
- $label = '';
+ $label = 'ToComplete';
} else {
$label = implode($this->getTooltipContentArray($params));
}