Skip to content

Commit

Permalink
Merge pull request frappe#22049 from shariquerik/restrict-creation-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik authored Aug 14, 2023
2 parents 379690f + f6aafb6 commit a7afb51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions frappe/desk/doctype/dashboard_chart/dashboard_chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
}
],
"links": [],
"modified": "2022-07-27 11:09:09.203236",
"modified": "2023-08-14 16:33:30.172798",
"modified_by": "Administrator",
"module": "Desk",
"name": "Dashboard Chart",
Expand Down Expand Up @@ -319,7 +319,6 @@
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
Expand Down
2 changes: 2 additions & 0 deletions frappe/public/js/frappe/views/reports/query_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
}

add_card_button_to_toolbar() {
if (!frappe.model.can_create("Number Card")) return;
this.page.add_inner_button(__("Create Card"), () => {
this.add_card_to_dashboard();
});
}

add_chart_buttons_to_toolbar(show) {
if (!frappe.model.can_create("Dashboard Chart")) return;
if (show) {
this.create_chart_button && this.create_chart_button.remove();
this.create_chart_button = this.page.add_button(__("Set Chart"), () => {
Expand Down

0 comments on commit a7afb51

Please sign in to comment.