diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js index e63bc50f3c..328df4f813 100644 --- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js +++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js @@ -148,7 +148,8 @@ frappe.ui.form.on('Invoice Discounting', { doc: frm.doc, callback: function(r) { if(!r.exc){ - frappe.set_route("Form", r.message.doctype, r.message.name); + var doclist = frappe.model.sync(r.message); + frappe.set_route("Form", doclist[0].doctype, doclist[0].name); } } }); @@ -161,7 +162,8 @@ frappe.ui.form.on('Invoice Discounting', { doc: frm.doc, callback: function(r) { if(!r.exc){ - frappe.set_route("Form", r.message.doctype, r.message.name); + var doclist = frappe.model.sync(r.message); + frappe.set_route("Form", doclist[0].doctype, doclist[0].name); } } });