From 51d39a1dbbaaa2a47446a8dc7cf9cf691a539c17 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Tue, 15 Jul 2025 15:05:53 +0530 Subject: [PATCH] fix: reset to default (cherry picked from commit 7826565ce77a6d75b2e16011571f46512e7cb486) --- crm/api/dashboard.py | 6 ++++++ frontend/src/pages/Dashboard.vue | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/crm/api/dashboard.py b/crm/api/dashboard.py index 5a9c56b8..4bed4218 100644 --- a/crm/api/dashboard.py +++ b/crm/api/dashboard.py @@ -7,6 +7,12 @@ from crm.fcrm.doctype.crm_dashboard.crm_dashboard import create_default_manager_ from crm.utils import sales_user_only +@frappe.whitelist() +def reset_to_default(): + frappe.only_for("System Manager") + create_default_manager_dashboard(force=True) + + @frappe.whitelist() @sales_user_only def get_dashboard(from_date="", to_date="", user=""): diff --git a/frontend/src/pages/Dashboard.vue b/frontend/src/pages/Dashboard.vue index 51b873fe..ecaea290 100644 --- a/frontend/src/pages/Dashboard.vue +++ b/frontend/src/pages/Dashboard.vue @@ -29,6 +29,15 @@ icon-left="plus" @click="showAddChartModal = true" /> +