Greetings,
Ive created an app called Shows with a doctype called Show then i want to add a calendar view to my show doctype my js (show_calendar.js) looks like this
frappe.views.calendar["Show"] = {
field_map: {
"start": "start",
"end": "end",
"id": "name",
"title": "title",
"status": "status",
"allDay": "all_day",
},
get_events_method: "shows.shows.doctype.show.show.get_shows",
}
and my py (show.py) looks like this
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Show(Document):
pass
@frappe.whitelist()
def get_shows(start, end):
if not frappe.has_permission("Shows", "read"):
raise frappe.PermissionError
return frappe.db.sql("""select
timestamp(`date`, from_time) as start,
timestamp(`date`, to_time) as end,
name,
title,
status,
0 as all_day
from `tabShow`
where `date` between %(start)s and %(end)s""", {
"start": start,
"end": end
}, as_dict=True)
The actual issue is i cant see anything on the calendar and on the gantt view i see shows but occupying 2-3 days where it was only some hours.
CALENDAR
GANTT
Note: both are stored in frappe-bench/apps/shows/shows/shows/doctype/show$
Thanks,
Oasis