From 4aeee45530e1beda485b198992947f25bc376639 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 20 Aug 2013 17:09:05 +0530 Subject: [PATCH] [fix] [minor] get items from bom on material transfer against production order --- stock/doctype/stock_entry/stock_entry.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js index 529cb625349..8843a35fe8f 100644 --- a/stock/doctype/stock_entry/stock_entry.js +++ b/stock/doctype/stock_entry/stock_entry.js @@ -104,11 +104,11 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ callback: function(r) { if (!r.exc) me.frm.set_value("expense_adjustment_account", r.message); - me.get_items(); + me.get_items_onload(); } }); } else { - me.get_items(); + me.get_items_onload(); } }, @@ -121,6 +121,13 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ } }, + get_items_onload: function() { + if (this.frm.doc.__islocal && !getchildren('Stock Entry Detail', this.frm.doc.name, + 'mtn_details').length) { + this.get_items() + } + }, + get_items: function() { if(this.frm.doc.production_order || this.frm.doc.bom_no) { // if production order / bom is mentioned, get items