mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-30 02:14:48 +00:00
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:
committed by
Nabin Hait
parent
fd312be79f
commit
5f59c2ae75
@@ -502,8 +502,17 @@ def install_defaults(args=None):
|
|||||||
|
|
||||||
def add_dashboards():
|
def add_dashboards():
|
||||||
from erpnext.setup.setup_wizard.data.dashboard_charts import get_default_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()
|
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["Charts"])
|
||||||
make_records(dashboard_data["Dashboards"])
|
make_records(dashboard_data["Dashboards"])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user