diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index ac0aa60a647..a6f4a241f2f 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -169,6 +169,12 @@ if (empty($reshook)) { $moline->origin_type = 'free'; // free consume line $moline->position = 0; + if(!empty($moline->fk_product)){ + $product = new Product($db); + $product->fetch($moline->fk_product); + if($product->type == Product::TYPE_SERVICE) $moline->fk_default_workstation = $product->fk_default_workstation; + } + $resultline = $moline->create($user, false); // Never use triggers here if ($resultline <= 0) { $error++;