diff --git a/msp/hooks.py b/msp/hooks.py index 1a24064..4348ffd 100644 --- a/msp/hooks.py +++ b/msp/hooks.py @@ -39,6 +39,8 @@ jenv = { # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} # doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} +doctype_js = {"Location" : "public/js/location.js"} + # Home Pages # ---------- diff --git a/msp/public/js/location.js b/msp/public/js/location.js new file mode 100644 index 0000000..76b5adf --- /dev/null +++ b/msp/public/js/location.js @@ -0,0 +1,7 @@ +frappe.ui.form.on('Location', { + refresh(frm) { + frm.add_custom_button('Show IT Objects in Location', () => { + frappe.set_route('List', 'IT Object', { location_full_path: ['like', `%${frm.doc.location_name}%`] }) + }) + } +});