I want to add the button for “Go to route” in list view
please suggest me
What is the use case?
we want to redirect dashboard from button
e.g: redirect to stock balance report from Item list
frappe.listview_settings['doctype_name'] = { refresh: function(frm) { // add the button here } }
@Christian_Sanchezr you have to add this in hooks.py also:
doctype_list_js = {“doctype” : “public/js/doctype_list.js”}
@Christian_Sanchez It will not work because you do not write the correct path of item_list.js file.
It should be something like this:
doctype_js = {"Item":"public/js/item_list.js"}
@Christian_Sanchez you have to create a new file in your new custom app in public → js → item_list.js
@Mohammed_Redha yes I did this in my hooks put this code
doctype_js = {
“Item”:“item_list.js”,
“Item”: “item.js”,
}
and my item list put this
frappe.ui.form.on(“Item”, {
refresh: function(frm) {
frm.add_custom_button(__(“Generar Ticket”), function() {
var w = window.open(
frappe.urllib.get_full_url(“/api/method/nodux_enterprise_ticket.item.creahtml?”
+“item_code=”+(frm.doc.item_code)
));
}).addClass(“btn-primary”);
}
});
@Christian_Sanchez you have to change it to this :
doctype_js = {"Item":"public/js/item.js"}
doctype_list_js = {"Item" : "public/js/item_list.js"}
@Mohammed_Redha yes i do this but dont work my code in list_view.js
refresh: function(listview) {
frm.add_custom_button(__(“Generar Ticket”), function() {
console.log(“ingresaaaaa”)
}).addClass(“btn-primary”);
}
Any solution on this?
I having the same Issue
got any solution