[fix] if item code exists then only call get_item_details (#12258)

This commit is contained in:
Saurabh 2018-01-01 16:17:02 +05:30 committed by Nabin Hait
parent a6b41e855b
commit 9579645ae1

View File

@ -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: {