diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py index 09d4429712..3dc6b0f900 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py @@ -415,7 +415,7 @@ def make_maintenance_visit(source_name, target_doc=None, item_name=None, s_id=No }, "Maintenance Schedule Item": { "doctype": "Maintenance Visit Purpose", - "condition": lambda doc: doc.item_name == item_name, + "condition": lambda doc: doc.item_name == item_name if item_name else True, "field_map": {"sales_person": "service_person"}, "postprocess": update_serial, },