@frappe.whitelist()
def get_events(start, end, filters=None):
 from frappe.desk.calendar import get_event_conditions
 conditions = get_event_conditions(u'Sales Order', filters)
 data = frappe.db.sql(u"select name, customer_name, delivery_status, billing_status, delivery_date\n DCTB  DCTB from `tabSales Order`\n DCTB  DCTB where (ifnull(delivery_date, '0000-00-00')!= '0000-00-00')  DCTB  DCTB  DCTB  DCTB and (delivery_date between %(start)s and %(end)s)\n DCTB  DCTB  DCTB  DCTB and docstatus < 2\n DCTB  DCTB  DCTB  DCTB {conditions}\n DCTB  DCTB ".format(conditions=conditions), {u'start': start, u'end': end}, as_dict=True, update={u'allDay': 0})
 return data

@ frappe . whitelist ( ) def get_events ( start , end , filters = None ) : from frappe . desk . calendar import get_event_conditions conditions = get_event_conditions ( u'Sales Order' , filters ) data = frappe . db . sql ( u"select name, customer_name, delivery_status, billing_status, delivery_date\n DCTB  DCTB from `tabSales Order`\n DCTB  DCTB where (ifnull(delivery_date, '0000-00-00')!= '0000-00-00')  DCTB  DCTB  DCTB  DCTB and (delivery_date between %(start)s and %(end)s)\n DCTB  DCTB  DCTB  DCTB and docstatus < 2\n DCTB  DCTB  DCTB  DCTB {conditions}\n DCTB  DCTB " . format ( conditions = conditions ) , { u'start' : start , u'end' : end } , as_dict = True , update = { u'allDay' : 0 } ) return data
returns events for gantt / calendar view rendering .