From 9579645ae16f17b6572e62b98df3d8feb2e980d3 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 1 Jan 2018 16:17:02 +0530 Subject: [PATCH] [fix] if item code exists then only call get_item_details (#12258) --- erpnext/agriculture/doctype/crop/crop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/agriculture/doctype/crop/crop.js b/erpnext/agriculture/doctype/crop/crop.js index 3f8a7fc3d20..afd84fd9f66 100644 --- a/erpnext/agriculture/doctype/crop/crop.js +++ b/erpnext/agriculture/doctype/crop/crop.js @@ -25,7 +25,7 @@ erpnext.crop.update_item_rate_uom = function(frm, cdt, cdn) { let material_list = ['materials_required', 'produce', 'byproducts']; material_list.forEach((material) => { frm.doc[material].forEach((item, index) => { - if (item.name == cdn){ + if (item.name == cdn && item.item_code){ frappe.call({ method:'erpnext.agriculture.doctype.crop.crop.get_item_details', args: {