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

(cherry picked from commit 60fb71bd2a)

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2022-04-12 11:16:59 +05:30
committed by GitHub
parent 54ea9319a1
commit 21066a48b6

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: {