From 07ef5f42c44b27f0cfd48ced365276e78b51d995 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 26 Apr 2017 18:25:54 +0530 Subject: [PATCH] [enhance] Show notification for draft state records if doctype is submittable --- erpnext/startup/notifications.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py index 58458c64eb3..57067a8da3f 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 @@ def get_notification_config(): "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