From 281a2d2bd1ab9db477ae1eb22c0dbe35fb065d8f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 4 Dec 2013 17:04:39 +0530 Subject: [PATCH] [fix] [minor] fetch items from bom while repacking --- stock/doctype/stock_entry/stock_entry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py index 919d6b26ca..ba0e72478c 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/stock/doctype/stock_entry/stock_entry.py @@ -444,6 +444,8 @@ class DocType(StockController): if self.doc.production_order and self.doc.purpose == "Material Transfer": item_dict = self.get_pending_raw_materials(pro_obj) else: + if not self.doc.fg_completed_qty: + webnotes.throw(_("Manufacturing Quantity is mandatory")) item_dict = self.get_bom_raw_materials(self.doc.fg_completed_qty) for item in item_dict.values(): if pro_obj: @@ -479,7 +481,7 @@ class DocType(StockController): where name=(select item from tabBOM where name=%s)""", self.doc.bom_no, as_dict=1) self.add_to_stock_entry_detail({ - item[0]["item"] : { + item[0]["name"] : { "qty": self.doc.fg_completed_qty, "item_name": item[0].item_name, "description": item[0]["description"],