[minor] don't trigger source_warehouse if item_code is not set in Production Order (#9806)
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index f6d9eaf..657819a 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 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: {