From 198041a5ef57b45dabd2125126f06e39c3bf08a9 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 8 May 2020 02:58:23 +0530 Subject: [PATCH] fix: dashboard sync issue --- frappe/utils/dashboard.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frappe/utils/dashboard.py b/frappe/utils/dashboard.py index cf64d9da61..7cc97ed3f9 100644 --- a/frappe/utils/dashboard.py +++ b/frappe/utils/dashboard.py @@ -87,7 +87,7 @@ def sync_dashboards(app=None): if config: frappe.flags.in_import = True make_records(config.charts, "Dashboard Chart") - make_records(config.number_cards, "Number Cards") + make_records(config.number_cards, "Number Card") make_records(config.dashboards, "Dashboard") frappe.flags.in_import = False @@ -95,10 +95,13 @@ def make_records(config, doctype): if not config: return - for item in config: - item["doctype"] = doctype - import_doc(item) - frappe.db.commit() + try: + for item in config: + item["doctype"] = doctype + import_doc(item) + frappe.db.commit() + except frappe.DuplicateEntryError: + pass def get_config(app, module): try: