Action button is working in "List View" but does not work in "Report View"

I added action to the menu using below script it while it is working in list view it does not work in report view, do I need to create it separately for report view, if so how do i do that?

frappe.listview_settings['Purchase Receipt'].onload = function(listview) {
    // add button to menu
    listview.page.add_action_item(__("Create Invoice"), function() {
    	console.log("Clicked")
});
};

Hi @akshay,

Please apply it.

frappe.listview_settings['Purchase Receipt'].refresh = function(listview) {
	listview.page.add_action_item(__("Create Invoice"), function() {
	   console.log("Clicked");
	   // add your code according.
	});
};

Then reload and check it.

Thank You!

Thanks, It is working now.