Update bom.class.php

This commit is contained in:
Laurent Destailleur 2022-01-10 20:58:08 +01:00 committed by GitHub
parent f5c04c81a9
commit c334c3cd58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -789,14 +789,12 @@ class BOM extends CommonObject
if (isset($this->label)) {
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
}
if (!empty($this->fk_product)) {
dol_include_once('/product/class/product.class.php');
if (!empty($this->fk_product) && $this->fk_product > 0) {
include_once DOL_DOCUMENT_ROO.'/product/class/product.class.php';
$product = new Product($db);
$resultFetch = $product->fetch($this->fk_product);
if ($resultFetch < 0) {
setEventMessages($product->error, $product->errors, 'errors');
} else {
$label .= "<br><b>".$langs->trans("Product").'</b>: '.$product->getNomUrl(0, '', 0, -1, 1);
if ($resultFetch > 0) {
$label .= "<br><b>".$langs->trans("Product").'</b>: '.$product->label;
}
}