[enhance] Show notification for draft state records if doctype is submittable
diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py
index 58458c6..57067a8 100644
--- a/erpnext/startup/notifications.py
+++ b/erpnext/startup/notifications.py
@@ -2,9 +2,10 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
+import frappe
def get_notification_config():
- return { "for_doctype":
+ notification_for_doctype = { "for_doctype":
{
"Issue": {"status": "Open"},
"Warranty Claim": {"status": "Open"},
@@ -57,3 +58,10 @@
"Timesheet": {"status": "Draft"}
}
}
+
+ doctype = [d for d in notification_for_doctype.get('for_doctype')]
+ for doc in frappe.get_all('DocType',
+ fields= ["name"], filters = {"name": ("not in", doctype), 'is_submittable': 1}):
+ notification_for_doctype["for_doctype"][doc.name] = {"docstatus": 0}
+
+ return notification_for_doctype