From 12b98027ee9771d8868562a1e0a73ab41718c645 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 29 Aug 2014 16:11:11 +0530 Subject: [PATCH] [fix] Maintenance Scheduler periodicity validation --- .../doctype/maintenance_schedule/maintenance_schedule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 4b06fe07fd1..a7396515292 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -134,7 +134,7 @@ class MaintenanceSchedule(TransactionBase): def validate_dates_with_periodicity(self): for d in self.get("item_maintenance_detail"): - if d.start_date and d.end_date and d.periodicity: + if d.start_date and d.end_date and d.periodicity and d.periodicity!="Random": date_diff = (getdate(d.end_date) - getdate(d.start_date)).days + 1 days_in_period = { "Weekly": 7,