fix: reload account timeline before creating dashboards (#18934)

* fix: sync account balance timeline.json before running patch

* fix: reload account timeline before creating dashboards
This commit is contained in:
Shivam Mishra 2019-09-09 13:20:53 +05:30 committed by Nabin Hait
parent fd312be79f
commit 5f59c2ae75

View File

@ -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"])