[fix] [minor] [stock entry] call get_items even if item exists and on saved document
diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js
index 53998f8..c1a8c00 100644
--- a/stock/doctype/stock_entry/stock_entry.js
+++ b/stock/doctype/stock_entry/stock_entry.js
@@ -122,16 +122,15 @@
},
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 b702316..5015349 100644
--- a/stock/doctype/stock_entry/stock_entry.py
+++ b/stock/doctype/stock_entry/stock_entry.py
@@ -571,7 +571,6 @@
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: