diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 863793063a0..902f167d819 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -77,3 +77,4 @@ UnitCost=Unit cost TotalCost=Total cost BOMTotalCost=The cost to produce this BOM based on cost of each quantity and product to consume (use Cost price if defined, else Average Weighted Price if defined, else the Best purchase price) GoOnTabProductionToProduceFirst=You must first have started the production to close a Manufacturing Order (See tab '%s'). But you can Cancel it. +ErrorAVirtualProductCantBeUsedIntoABomOrMo=A kit can't be used into a BOM or a MO \ No newline at end of file diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index a1893fbeba2..2f58c90a433 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -250,10 +250,11 @@ class Mo extends CommonObject $this->db->begin(); if ($this->fk_product > 0) { + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $tmpproduct = new Product($this->db); - $tmpproduct->feth($this->fk_product); + $tmpproduct->fetch($this->fk_product); if ($tmpproduct->hasFatherOrChild(1) > 0) { - $this->error = 'AVirtualProductCanBeUsedIntoAMO'; + $this->error = 'ErrorAVirtualProductCantBeUsedIntoABomOrMo'; $this->errors[] = $this->error; $this->db->rollback(); return -1;