From 5f59c2ae75df90c92567a7c47c169b643b678cf3 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 9 Sep 2019 13:20:53 +0530 Subject: [PATCH] fix: reload account timeline before creating dashboards (#18934) * fix: sync account balance timeline.json before running patch * fix: reload account timeline before creating dashboards --- .../setup/setup_wizard/operations/install_fixtures.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index 7123021d1e..6dbb89062e 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -502,8 +502,17 @@ def install_defaults(args=None): def add_dashboards(): from erpnext.setup.setup_wizard.data.dashboard_charts import get_default_dashboards + from frappe.modules.import_file import import_file_by_path + dashboard_data = get_default_dashboards() + # create account balance timeline before creating dashbaord charts + doctype = "dashboard_chart_source" + docname = "account_balance_timeline" + folder = os.path.dirname(frappe.get_module("erpnext.accounts").__file__) + doc_path = os.path.join(folder, doctype, docname, docname) + ".json" + import_file_by_path(doc_path, force=0, for_sync=True) + make_records(dashboard_data["Charts"]) make_records(dashboard_data["Dashboards"])