diff --git a/frappe/desk/doctype/event/event.py b/frappe/desk/doctype/event/event.py index b1306b432e..92de672983 100644 --- a/frappe/desk/doctype/event/event.py +++ b/frappe/desk/doctype/event/event.py @@ -28,7 +28,7 @@ class Event(Document): if self.starts_on and self.ends_on: self.validate_from_to_dates("starts_on", "ends_on") - if self.repeat_on == "Daily" and getdate(self.starts_on) != getdate(self.ends_on): + if self.repeat_on == "Daily" and self.ends_on and getdate(self.starts_on) != getdate(self.ends_on): frappe.throw(_("Daily Events should finish on the Same Day.")) def on_update(self): @@ -194,6 +194,7 @@ def get_events(start, end, user=None, for_reminder=False, filters=None): AND `tabDocShare`.user=%(user)s ) ) + AND `tabEvent`.status='Open' ORDER BY `tabEvent`.starts_on""".format( filter_condition=get_filters_cond('Event', filters, []), reminder_condition="AND coalesce(`tabEvent`.send_reminder, 0)=1" if for_reminder else "" @@ -317,4 +318,4 @@ def set_status_of_events(): if (event.ends_on and getdate(event.ends_on) < getdate(nowdate())) \ or (event.repeat_till and getdate(event.repeat_till) < getdate(nowdate())): - frappe.db.set_value("Event", event.name, "status", "Closed") \ No newline at end of file + frappe.db.set_value("Event", event.name, "status", "Closed")