feat: add button to go to ref doctype list

This commit is contained in:
prssanna 2020-05-28 14:24:33 +05:30
parent 62ac2494e7
commit c7f0aafa7e

View file

@ -5,6 +5,12 @@ frappe.ui.form.on("Workflow", {
frm.set_query("document_type", {"issingle": 0, "istable": 0});
},
refresh: function(frm) {
if (frm.doc.document_type) {
frm.add_custom_button(__('Go to {0} List', [frm.doc.document_type]), () => {
frappe.set_route('List', frm.doc.document_type);
});
}
frm.events.update_field_options(frm);
frm.ignore_warning = frm.is_new() ? true : false;