Fix bom
This commit is contained in:
parent
5bcd89d66c
commit
73bdb71507
2 changed files with 13 additions and 5 deletions
|
|
@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('mrp', 'other'));
|
||||
|
|
@ -687,8 +688,17 @@ while ($i < $imaxinloop) {
|
|||
print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
|
||||
print '<div class="box-flex-container kanban">';
|
||||
}
|
||||
|
||||
// TODO Use a cache for product
|
||||
if (!empty($obj->fk_product)) {
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($obj->fk_product);
|
||||
} else {
|
||||
$prod = null;
|
||||
}
|
||||
|
||||
// Output kanban
|
||||
print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected)));
|
||||
print $object->getKanbanView('', array('prod'=>$prod, 'selected' => in_array($object->id, $arrayofselected)));
|
||||
if ($i == ($imaxinloop - 1)) {
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
|
|
|
|||
|
|
@ -1617,9 +1617,6 @@ class BOM extends CommonObject
|
|||
|
||||
$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
|
||||
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($this->fk_product);
|
||||
|
||||
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||
$return .= '<div class="info-box info-box-sm">';
|
||||
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||
|
|
@ -1636,7 +1633,8 @@ class BOM extends CommonObject
|
|||
$return .= '<span class="info-box-label">'.$this->fields['bomtype']['arrayofkeyval'][1].'</span>';
|
||||
}
|
||||
}
|
||||
if (property_exists($this, 'fk_product') && !is_null($this->fk_product)) {
|
||||
if (!empty($arraydata['prod'])) {
|
||||
$prod = $arraydata['prod'];
|
||||
$return .= '<br><span class="info-box-label">'.$prod->getNomUrl(1).'</span>';
|
||||
}
|
||||
if (method_exists($this, 'getLibStatut')) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue