fix: HSN/SAC Error while creating a new item and not selecting the field. #20590
This commit is contained in:
parent
db00270895
commit
0047fcf7ad
@ -137,7 +137,7 @@ frappe.ui.form.on("Item", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
gst_hsn_code: function(frm) {
|
gst_hsn_code: function(frm) {
|
||||||
if(!frm.doc.taxes || !frm.doc.taxes.length) {
|
if((!frm.doc.taxes || !frm.doc.taxes.length) && frm.doc.gst_hsn_code) {
|
||||||
frappe.db.get_doc("GST HSN Code", frm.doc.gst_hsn_code).then(hsn_doc => {
|
frappe.db.get_doc("GST HSN Code", frm.doc.gst_hsn_code).then(hsn_doc => {
|
||||||
$.each(hsn_doc.taxes || [], function(i, tax) {
|
$.each(hsn_doc.taxes || [], function(i, tax) {
|
||||||
let a = frappe.model.add_child(cur_frm.doc, 'Item Tax', 'taxes');
|
let a = frappe.model.add_child(cur_frm.doc, 'Item Tax', 'taxes');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user