Create a Gantt View for new Doctype

Hi,

I am trying to make a new DOCTYPE that requires the use of Gantt View in order to view the work flow a user needs to accomplish. I followed this doc:

https://frappeframework.com/docs/v14/user/en/desk#gantt-view

Which states that if I have calendar view, the Gantt View is automatic. So in the DOCTYPE there is an option to generate Calendar View (As well as Kanban). Was able to create it, successfully showing records on the calendar. But when I go back to the DOCTYPE’s List view, the calendar option disappears from the list. I get the default List, Report, and Kanban options.

This document from frappé says that I need to create a file in order to view the calendar view. Since I was able to do this from the UI, so my question is:

** Is it necessary to touch code in order to create my Gantt Code? Or is there an easier way to do this.

I am currently using V14, and using Frappé Cloud, so no access to bench.

Same issue here, did you resolve it?

Hi, not specifically this issue (tbh i haven’t tried) but recently I was struggeling with Calendar view, which is kind of similar, i was able to get it working through client scripts for the list (not form). Here is a code I used for this:

frappe.ui.form.on('Production Order', {
	refresh(frm) {
		// your code here
	}
})

frappe.views.calendar["Production Order"] = {
	field_map: {
		"start": "start_date",
		"end": "end_date",
		"id": "name",
		"title": "name",
		"allDay": "allDay",
		"progress": "progress"
	}
};

I haven’t given this a try for the Gantt, as I had completely forgetten about it. But in a few days time I’ll give it a try. Let me know if this worked for you or if you make some tweeks share it so we can all benefit!

After reading your post, couldn’t put it down. I used Chat GPT to help me out with the code, and it gave me this:

frappe.views.calendar[“Production Order”] = {
field_map: {
“start”: “start_date”,
“end”: “end_date”,
“id”: “name”,
“title”: “name”,
“allDay”: “allDay”, // You can remove this if not applicable
“progress”: “progress” // Add any other field you need
},
gantt: true // Enable Gantt view
};

Put this piece of code right below the previous code i shared and it worked!! So just add teh gantt: true and you should be good to go!