diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 78b7e78f91f..b61a65f95a2 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -667,10 +667,10 @@ class BOM extends CommonObject * @param float $efficiency Efficiency in MO * @param int $position Position of BOM-Line in BOM-Lines * @param string $import_key Import Key - * @param int $fk_unit Unit of line + * @param int $fk_unit Unit of line * @return int <0 if KO, Id of updated BOM-Line if OK */ - public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null, $fk_unit) + public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null, $fk_unit = 0) { global $mysoc, $conf, $langs, $user; @@ -740,7 +740,7 @@ class BOM extends CommonObject $this->line->efficiency = $efficiency; $this->line->import_key = $import_key; $this->line->position = $rankToUse; - $this->line->fk_unit = $fk_unit; + if(!empty($fk_unit)) $this->line->fk_unit = $fk_unit; $result = $this->line->update($user);