fix: Get invoice details only if invoice is selected

This commit is contained in:
Deepesh Garg
2020-03-10 10:36:05 +05:30
parent b7bbd827fd
commit ee003495f6

View File

@@ -32,10 +32,12 @@ frappe.ui.form.on('C-Form Invoice Detail', {
invoice_no(frm, cdt, cdn) { invoice_no(frm, cdt, cdn) {
let d = frappe.get_doc(cdt, cdn); let d = frappe.get_doc(cdt, cdn);
frm.call('get_invoice_details', { if (d.invoice_no) {
invoice_no: d.invoice_no frm.call('get_invoice_details', {
}).then(r => { invoice_no: d.invoice_no
frappe.model.set_value(cdt, cdn, r.message); }).then(r => {
}); frappe.model.set_value(cdt, cdn, r.message);
});
}
} }
}); });