I want to override the Project and Task HRML template in ERPNext version 15. I did not get the base template or any method for overriding the default template in my custom frappe app.
Can anyone guide here on how to override or change the default page template in ERPNext version 15?
NCP
May 29, 2024, 6:26am
2
Hi @njbhatt18 ,
Please check the file.
frappe.ready(function () {
$(".task-status-switch").on("click", function () {
var $btn = $(this);
if ($btn.attr("data-status") === "Open") {
reload_items("completed", "task", $btn);
} else {
reload_items("open", "task", $btn);
}
});
$(".issue-status-switch").on("click", function () {
var $btn = $(this);
if ($btn.attr("data-status") === "Open") {
reload_items("completed", "issue", $btn);
} else {
reload_items("open", "issue", $btn);
}
});
var start = 10;
This file has been truncated. show original
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def get_context(context):
project_user = frappe.db.get_value(
"Project User",
{"parent": frappe.form_dict.project, "user": frappe.session.user},
["user", "view_attachments"],
as_dict=True,
)
if frappe.session.user != "Administrator" and (not project_user or frappe.session.user == "Guest"):
raise frappe.PermissionError
context.no_cache = 1
context.show_sidebar = True
project = frappe.get_doc("Project", frappe.form_dict.project)
This file has been truncated. show original
Please create the same three files with the same path in your custom app and set it according to the scenario.
Output:
1 Like
Thanks for your reply. I did it according to your example, unfortunately no luck. Do I need anything in hooks.py
file?