frappe call only if item code or serial no is ther (#12036)

diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 79afb21..4c5031d 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -191,16 +191,18 @@
 			'allow_zero_valuation': 1,
 		};
 
-		frappe.call({
-			method: "erpnext.stock.utils.get_incoming_rate",
-			args: {
-				args: args
-			},
-			callback: function(r) {
-				frappe.model.set_value(cdt, cdn, 'basic_rate', (r.message || 0.0));
-				frm.events.calculate_basic_amount(frm, item);
-			}
-		})
+		if (item.item_code || item.serial_no) {
+			frappe.call({
+				method: "erpnext.stock.utils.get_incoming_rate",
+				args: {
+					args: args
+				},
+				callback: function(r) {
+					frappe.model.set_value(cdt, cdn, 'basic_rate', (r.message || 0.0));
+					frm.events.calculate_basic_amount(frm, item);
+				}
+			});
+		}
 	},
 
 	get_warehouse_details: function(frm, cdt, cdn) {