From e24a50b32787de747d07cbca2a135ffd4bd9444a Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Tue, 3 Feb 2026 17:55:34 +0530 Subject: [PATCH] feat: autocreate calendar controller file --- .../core/doctype/doctype/boilerplate/controller_calendar.js | 5 +++++ frappe/core/doctype/doctype/doctype.py | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 frappe/core/doctype/doctype/boilerplate/controller_calendar.js diff --git a/frappe/core/doctype/doctype/boilerplate/controller_calendar.js b/frappe/core/doctype/doctype/boilerplate/controller_calendar.js new file mode 100644 index 0000000000..c9a4d37756 --- /dev/null +++ b/frappe/core/doctype/doctype/boilerplate/controller_calendar.js @@ -0,0 +1,5 @@ +// Copyright (c) {year}, {app_publisher} and contributors +// For license information, please see license.txt + +frappe.views.calendar["{doctype}"] = {{ +}}; \ No newline at end of file diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index 58ec4f8afa..bee4a3ee2e 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -880,6 +880,9 @@ class DocType(Document): if self.is_tree: make_boilerplate("controller_tree.js", self.as_dict()) + if self.is_calendar_and_gantt: + make_boilerplate("controller_calendar.js", self.as_dict()) + if self.has_web_view: templates_path = frappe.get_module_path( frappe.scrub(self.module), "doctype", frappe.scrub(self.name), "templates"