Merge branch 'FIX/check_if_allowed_to_add_bom_as_bomline' of github.com:atm-gauthier/dolibarr into FIX/check_if_allowed_to_add_bom_as_bomline

This commit is contained in:
Gauthier PC portable 024 2022-09-02 08:44:29 +02:00
commit f1e98f2d35
2 changed files with 5 additions and 9 deletions

View File

@ -1155,7 +1155,8 @@ class BOM extends CommonObject
* @param int $bom_id ID of bom from which we want to get parent bom ids * @param int $bom_id ID of bom from which we want to get parent bom ids
* @return void * @return void
*/ */
public function getParentBomTreeRecursive(&$TParentBom, $bom_id) { public function getParentBomTreeRecursive(&$TParentBom, $bom_id)
{
$sql = 'SELECT l.fk_bom, b.label $sql = 'SELECT l.fk_bom, b.label
FROM '.MAIN_DB_PREFIX.'bom_bomline l FROM '.MAIN_DB_PREFIX.'bom_bomline l
@ -1164,16 +1165,11 @@ class BOM extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!empty($resql)) { if (!empty($resql)) {
while ($res = $this->db->fetch_object($resql)) { while ($res = $this->db->fetch_object($resql)) {
$TParentBom[$res->fk_bom] = $res->fk_bom; $TParentBom[$res->fk_bom] = $res->fk_bom;
$this->getParentBomTreeRecursive($TParentBom, $res->fk_bom); $this->getParentBomTreeRecursive($TParentBom, $res->fk_bom);
} }
} }
} }
} }