From 98229db3ae4ed31271ccd36b0e2c24cf0d2316c8 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Tue, 5 May 2020 16:02:16 +0530 Subject: [PATCH] feat: Default Dashboard for Healthcare Workspace (#21414) * feat: Default Dashboard for Healthcare Workspace * fix: patch * Update add_healthcare_dashboard.py * fix: failing patch test Co-authored-by: Nabin Hait Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> --- .../desk_page/healthcare/healthcare.json | 9 +++++++-- erpnext/patches.txt | 2 +- .../patches/v12_0/add_default_dashboards.py | 1 + .../setup_wizard/data/dashboard_charts.py | 18 +++++++++++++++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/erpnext/healthcare/desk_page/healthcare/healthcare.json b/erpnext/healthcare/desk_page/healthcare/healthcare.json index 24c6d6fc37..5cf09b34b2 100644 --- a/erpnext/healthcare/desk_page/healthcare/healthcare.json +++ b/erpnext/healthcare/desk_page/healthcare/healthcare.json @@ -47,7 +47,12 @@ } ], "category": "Domains", - "charts": [], + "charts": [ + { + "chart_name": "Patient Appointments", + "label": "Patient Appointments" + } + ], "charts_label": "", "creation": "2020-03-02 17:23:17.919682", "developer_mode_only": 0, @@ -58,7 +63,7 @@ "idx": 0, "is_standard": 1, "label": "Healthcare", - "modified": "2020-04-20 11:42:43.889576", + "modified": "2020-04-25 22:31:36.576444", "modified_by": "Administrator", "module": "Healthcare", "name": "Healthcare", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index c9642924dc..ba17b67de1 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -630,7 +630,7 @@ execute:frappe.reload_doc('desk', 'doctype', 'dashboard') execute:frappe.reload_doc('desk', 'doctype', 'dashboard_chart_source') execute:frappe.reload_doc('desk', 'doctype', 'dashboard_chart') execute:frappe.reload_doc('desk', 'doctype', 'dashboard_chart_field') -erpnext.patches.v12_0.add_default_dashboards +erpnext.patches.v12_0.add_default_dashboards # 2020-04-05 erpnext.patches.v12_0.remove_bank_remittance_custom_fields erpnext.patches.v12_0.generate_leave_ledger_entries execute:frappe.delete_doc_if_exists("Report", "Loan Repayment") diff --git a/erpnext/patches/v12_0/add_default_dashboards.py b/erpnext/patches/v12_0/add_default_dashboards.py index 0c3f2f86ae..24661ccfea 100644 --- a/erpnext/patches/v12_0/add_default_dashboards.py +++ b/erpnext/patches/v12_0/add_default_dashboards.py @@ -6,4 +6,5 @@ from erpnext.setup.setup_wizard.operations.install_fixtures import add_dashboard def execute(): frappe.reload_doc("desk", "doctype", "number_card_link") + frappe.reload_doc("desk", "doctype", "patient_appointment") add_dashboards() diff --git a/erpnext/setup/setup_wizard/data/dashboard_charts.py b/erpnext/setup/setup_wizard/data/dashboard_charts.py index bb8c1319bf..b182dfc103 100644 --- a/erpnext/setup/setup_wizard/data/dashboard_charts.py +++ b/erpnext/setup/setup_wizard/data/dashboard_charts.py @@ -29,7 +29,8 @@ def get_default_dashboards(): { "chart": "Incoming Bills (Purchase Invoice)" }, { "chart": "Bank Balance" }, { "chart": "Income" }, - { "chart": "Expenses" } + { "chart": "Expenses" }, + { "chart": "Patient Appointments" } ] } ], @@ -107,6 +108,21 @@ def get_default_dashboards(): "document_type": "Sales Invoice", "type": "Bar", "width": "Half" + }, + { + "doctype": "Dashboard Chart", + "time_interval": "Daily", + "chart_name": "Patient Appointments", + "timespan": "Last Month", + "color": "#77ecca", + "filters_json": json.dumps({}), + "chart_type": "Count", + "timeseries": 1, + "based_on": "appointment_datetime", + "owner": "Administrator", + "document_type": "Patient Appointment", + "type": "Line", + "width": "Half" } ] }