From c2bc3b20bbfd8c40c0e41326f3e8ea9f62417ec6 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 17 Feb 2022 11:05:03 +0100 Subject: [PATCH] Don't display collapse if no bom on bomline --- htdocs/mrp/tpl/originproductline.tpl.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index d261764f1c8..78d58062d4c 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -45,10 +45,12 @@ print 'getNomUrl(1); - print ' '; - print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); + if($tmpbom->id) { + print ' ' . $langs->trans("or") . ' '; + print $tmpbom->getNomUrl(1); + print ' '; + print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); + } print ''; } else { print $this->tpl['label']; @@ -92,6 +94,7 @@ $resql = $this->db->query($sql); if ($resql) { // Loop on all the sub-BOM lines if they exist while ($obj = $this->db->fetch_object($resql)) { + $sub_bom_product = new Product($this->db); $sub_bom_product->fetch($obj->fk_product); $sub_bom_product->load_stock();