fix include

This commit is contained in:
Florian HENRY 2022-01-07 08:27:49 +01:00
parent a0fb0b8741
commit 59b1feaf2e
2 changed files with 3 additions and 1 deletions

View File

@ -790,6 +790,7 @@ class BOM extends CommonObject
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
}
if (!empty($this->fk_product)) {
dol_include_once('/product/class/product.class.php');
$product = new Product($db);
$resultFetch = $product->fetch($this->fk_product);
if ($resultFetch < 0) {

View File

@ -155,7 +155,7 @@ print '</div><div class="fichetwothirdright">';
$max = 5;
$sql = "SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status";
$sql = "SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status, a.fk_product";
$sql .= " FROM ".MAIN_DB_PREFIX."bom_bom as a";
$sql .= " WHERE a.entity IN (".getEntity('bom').")";
$sql .= $db->order("a.tms", "DESC");
@ -176,6 +176,7 @@ if ($resql) {
$staticbom->id = $obj->rowid;
$staticbom->ref = $obj->ref;
$staticbom->fk_product = $obj->fk_product;
$staticbom->date_modification = $obj->datem;
$staticbom->status = $obj->status;