From c46d044efe8f696cf411b69864046dc0e26e776f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sat, 17 Aug 2013 12:38:23 +0530 Subject: [PATCH] [fix] [minor] [stock entry] call get_items even if item exists and on saved document --- stock/doctype/stock_entry/stock_entry.js | 19 +++++++++---------- stock/doctype/stock_entry/stock_entry.py | 1 - 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js index 53998f83e8..c1a8c000c0 100644 --- a/stock/doctype/stock_entry/stock_entry.js +++ b/stock/doctype/stock_entry/stock_entry.js @@ -122,16 +122,15 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ }, get_items: function() { - if(this.frm.doc.__islocal && (this.frm.doc.production_order || this.frm.doc.bom_no) - && !getchildren('Stock Entry Detail', this.frm.doc.name, 'mtn_details').length) { - // if production order / bom is mentioned, get items - return this.frm.call({ - doc: this.frm.doc, - method: "get_items", - callback: function(r) { - if(!r.exc) refresh_field("mtn_details"); - } - }); + if(this.frm.doc.production_order || this.frm.doc.bom_no) { + // if production order / bom is mentioned, get items + return this.frm.call({ + doc: this.frm.doc, + method: "get_items", + callback: function(r) { + if(!r.exc) refresh_field("mtn_details"); + } + }); } }, diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py index b702316d9b..50153494f0 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/stock/doctype/stock_entry/stock_entry.py @@ -571,7 +571,6 @@ class DocType(StockController): for item in item_dict: pending_to_issue = (max_qty * item_dict[item]["qty"]) - issued_item_qty.get(item, 0) desire_to_transfer = flt(self.doc.fg_completed_qty) * item_dict[item]["qty"] - if desire_to_transfer <= pending_to_issue: item_dict[item]["qty"] = desire_to_transfer else: