List View and Report View use different files
list_view.js and report_view.js
Both extend base_list.js
base_list.js loads the custom listview_settings code:
Then: list_view.js calls onload method from the custom settings in the setup_view method
But report_view.js on his setup_view method won’t call custom onload
Your option is to use refresh listener, which is called from base_list.js
In your workday_list.js
refresh: function (listview) {
listview.page.add_inner_button(__("Bulk Add"), function () {
// function here. Will Add it to List View and Report View
});
}
Another Approach
You can create a Custom Report. Eg: Script Report and be able to customize the report view itself
Docs: Script Report
Example: [Tutorial] Script Report / Chart
Look for the .js file → frappe.query_reports["Script Report Tutorial"] = {
frappe.query_reports["Workday Report"] = {
onload: function (report) {
report.page.add_inner_button(__("Bulk Add"), function() {
// function here. Will Add only to Report View
});
}
}