2015-03-03 14:55:30 +05:30
|
|
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
2013-12-13 15:33:40 +05:30
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
2017-04-26 18:25:54 +05:30
|
|
|
import frappe
|
2013-12-13 15:33:40 +05:30
|
|
|
|
|
|
|
def get_notification_config():
|
2017-04-26 18:25:54 +05:30
|
|
|
notification_for_doctype = { "for_doctype":
|
2013-12-13 15:33:40 +05:30
|
|
|
{
|
2015-03-02 13:01:39 +05:30
|
|
|
"Issue": {"status": "Open"},
|
|
|
|
"Warranty Claim": {"status": "Open"},
|
2017-03-09 18:11:11 +05:30
|
|
|
"Task": {"status": ("in", ("Open", "Overdue"))},
|
2015-07-17 15:03:18 +05:30
|
|
|
"Project": {"status": "Open"},
|
2016-04-14 17:30:40 +05:30
|
|
|
"Item": {"total_projected_qty": ("<", 0)},
|
2015-03-02 13:01:39 +05:30
|
|
|
"Lead": {"status": "Open"},
|
|
|
|
"Contact": {"status": "Open"},
|
2015-04-13 16:58:47 +05:30
|
|
|
"Opportunity": {"status": "Open"},
|
|
|
|
"Quotation": {"docstatus": 0},
|
2015-10-02 12:42:48 +05:30
|
|
|
"Sales Order": {
|
2016-02-22 16:24:23 +05:30
|
|
|
"status": ("not in", ("Completed", "Closed")),
|
2015-10-02 12:42:48 +05:30
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2015-03-02 13:01:39 +05:30
|
|
|
"Journal Entry": {"docstatus": 0},
|
2016-09-05 14:35:23 +05:30
|
|
|
"Sales Invoice": {
|
2017-01-30 12:29:54 +05:30
|
|
|
"outstanding_amount": (">", 0),
|
|
|
|
"docstatus": ("<", 2)
|
2016-09-05 14:35:23 +05:30
|
|
|
},
|
|
|
|
"Purchase Invoice": {
|
2017-01-30 12:29:54 +05:30
|
|
|
"outstanding_amount": (">", 0),
|
2016-09-05 14:35:23 +05:30
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2016-11-05 01:14:29 +05:30
|
|
|
"Payment Entry": {"docstatus": 0},
|
2015-03-02 13:01:39 +05:30
|
|
|
"Leave Application": {"status": "Open"},
|
|
|
|
"Expense Claim": {"approval_status": "Draft"},
|
|
|
|
"Job Applicant": {"status": "Open"},
|
2016-09-05 14:35:23 +05:30
|
|
|
"Delivery Note": {
|
|
|
|
"status": ("not in", ("Completed", "Closed")),
|
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2015-03-02 13:01:39 +05:30
|
|
|
"Stock Entry": {"docstatus": 0},
|
2016-02-27 16:24:34 +05:30
|
|
|
"Material Request": {
|
2016-03-07 19:35:34 +05:30
|
|
|
"docstatus": ("<", 2),
|
2016-02-27 16:24:34 +05:30
|
|
|
"status": ("not in", ("Stopped",)),
|
|
|
|
"per_ordered": ("<", 100)
|
|
|
|
},
|
2016-04-11 17:34:25 +05:30
|
|
|
"Request for Quotation": { "docstatus": 0 },
|
|
|
|
"Supplier Quotation": {"docstatus": 0},
|
2015-10-02 12:42:48 +05:30
|
|
|
"Purchase Order": {
|
2016-02-22 16:24:23 +05:30
|
|
|
"status": ("not in", ("Completed", "Closed")),
|
2015-10-02 12:42:48 +05:30
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2016-09-05 14:35:23 +05:30
|
|
|
"Purchase Receipt": {
|
|
|
|
"status": ("not in", ("Completed", "Closed")),
|
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2016-04-14 17:30:40 +05:30
|
|
|
"Production Order": { "status": ("in", ("Draft", "Not Started", "In Process")) },
|
2015-03-02 13:01:39 +05:30
|
|
|
"BOM": {"docstatus": 0},
|
2016-07-06 20:12:58 +05:30
|
|
|
"Timesheet": {"status": "Draft"}
|
2013-12-13 15:33:40 +05:30
|
|
|
}
|
2015-02-25 12:04:49 +05:30
|
|
|
}
|
2017-04-26 18:25:54 +05:30
|
|
|
|
|
|
|
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
|