From 00746306a300b81cea3c63f5ec422578de6f029d Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Fri, 10 Jan 2020 15:01:50 +0530 Subject: [PATCH] fix: Item tax template fetching from HSN Code --- erpnext/stock/doctype/item/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 253390ac50..dd3248baf2 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -137,7 +137,7 @@ frappe.ui.form.on("Item", { }, gst_hsn_code: function(frm) { - if(!frm.doc.taxes.length) { + if(!frm.doc.taxes || !frm.doc.taxes.length) { frappe.db.get_doc("GST HSN Code", frm.doc.gst_hsn_code).then(hsn_doc => { $.each(hsn_doc.taxes || [], function(i, tax) { let a = frappe.model.add_child(cur_frm.doc, 'Item Tax', 'taxes');