Update event.py
This commit is contained in:
parent
ac87ebc3ae
commit
b3d2d10c22
1 changed files with 3 additions and 2 deletions
|
|
@ -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")
|
||||
frappe.db.set_value("Event", event.name, "status", "Closed")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue