Merge pull request #35761 from KAVIRAJ0712/fix-client-script
This commit is contained in:
commit
17d0d30304
1 changed files with 7 additions and 3 deletions
|
|
@ -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") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue