Merge pull request #10265 from rohitwaghchaure/fixed-no-module-name-number-cards

fix: dashboard sync issue
This commit is contained in:
Shivam Mishra 2020-05-08 11:34:00 +05:30 committed by GitHub
commit e5a1b2239c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: