fix: ignore item-less maintenance visit for sr no (#30684)

This commit is contained in:
Ankush Menat 2022-04-12 11:14:02 +05:30 committed by GitHub
parent 7d263e9ecf
commit 60fb71bd2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,9 @@ frappe.ui.form.on('Maintenance Visit', {
// filters for serial no based on item code
if (frm.doc.maintenance_type === "Scheduled") {
let item_code = frm.doc.purposes[0].item_code;
if (!item_code) {
return;
}
frappe.call({
method: "erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule.get_serial_nos_from_schedule",
args: {