Merge pull request #35761 from KAVIRAJ0712/fix-client-script

This commit is contained in:
Soham Kulkarni 2026-02-01 21:34:00 +05:30 committed by GitHub
commit 17d0d30304
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,9 +9,13 @@ frappe.ui.form.on("Client Script", {
},
refresh(frm) {
if (frm.doc.dt && frm.doc.script) {
frm.add_custom_button(__("Go to {0}", [frm.doc.dt]), () =>
frappe.set_route("List", frm.doc.dt, "List")
);
frm.add_custom_button(__("Go to {0}", [frm.doc.dt]), () => {
if (frappe.model.is_single(frm.doc.dt)) {
frappe.set_route("Form", frm.doc.dt);
} else {
frappe.set_route("List", frm.doc.dt);
}
});
}
if (frm.doc.view == "Form") {