From 1efb05233cd3c75ccceea930cd957e1abd3b4f93 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Wed, 12 Jul 2017 14:53:14 +0530 Subject: [PATCH] [minor] don't trigger source_warehouse if item_code is not set in Production Order (#9806) --- .../doctype/production_order/production_order.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index f6d9eafdab..657819a0b0 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -212,7 +212,9 @@ frappe.ui.form.on("Production Order", { frappe.ui.form.on("Production Order Item", { source_warehouse: function(frm, cdt, cdn) { var row = locals[cdt][cdn]; - if(row.source_warehouse) { + if(!row.item_code) { + frappe.throw(__("Please set the Item Code first")); + } else if(row.source_warehouse) { frappe.call({ "method": "erpnext.stock.utils.get_latest_stock_qty", args: {