Merge pull request #20237 from deepeshgarg007/hsn_template

fix: Item tax template fetching from HSN Code
This commit is contained in:
Deepesh Garg 2020-01-10 21:45:48 +05:30 committed by GitHub
commit 23d4a0ec48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');