From d0786b45c36e2d861b54a9e396d81f16bc0fee39 Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Mon, 19 Mar 2018 22:17:37 +0530 Subject: [PATCH] fix issue --- erpnext/utilities/user_progress.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/erpnext/utilities/user_progress.py b/erpnext/utilities/user_progress.py index cdb0e14f30..9f5935e3cb 100644 --- a/erpnext/utilities/user_progress.py +++ b/erpnext/utilities/user_progress.py @@ -12,10 +12,13 @@ def get_slide_settings(): currency = defaults.get("currency") or '' doc = frappe.get_doc("Setup Progress") - item = [d for d in doc.get("actions") if d.action_name == "Set Sales Target"][0] - if not item.action_document: - item.action_document = company - doc.save() + item = [d for d in doc.get("actions") if d.action_name == "Set Sales Target"] + + if len(item): + item = item[0] + if not item.action_document: + item.action_document = company + doc.save() # Initial state of slides return [