Merge pull request #13333 from achillesrasquinha/hotfixes

Check Set Sales Target Item exists in User Slides
This commit is contained in:
Achilles Rasquinha 2018-03-19 22:23:11 +05:30 committed by GitHub
commit 54f3a0f7c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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