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-07-18 10:35:12 +05:30
|
|
|
notifications = { "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"},
|
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},
|
2018-01-24 18:21:18 +05:30
|
|
|
"Leave Application": {"docstatus": 0},
|
2018-02-16 14:49:39 +05:30
|
|
|
"Expense Claim": {"docstatus": 0},
|
2015-03-02 13:01:39 +05:30
|
|
|
"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)
|
|
|
|
},
|
2018-03-20 12:38:43 +05:30
|
|
|
"Work Order": { "status": ("in", ("Draft", "Not Started", "In Process")) },
|
2015-03-02 13:01:39 +05:30
|
|
|
"BOM": {"docstatus": 0},
|
2017-09-13 12:52:30 +05:30
|
|
|
|
|
|
|
"Timesheet": {"status": "Draft"},
|
|
|
|
|
|
|
|
"Lab Test": {"docstatus": 0},
|
|
|
|
"Sample Collection": {"docstatus": 0},
|
|
|
|
"Patient Appointment": {"status": "Open"},
|
2018-07-16 18:08:53 +05:30
|
|
|
"Patient Encounter": {"docstatus": 0}
|
2017-07-18 10:35:12 +05:30
|
|
|
},
|
|
|
|
|
|
|
|
"targets": {
|
|
|
|
"Company": {
|
2017-09-04 11:14:04 +05:30
|
|
|
"filters" : { "monthly_sales_target": ( ">", 0 ) },
|
|
|
|
"target_field" : "monthly_sales_target",
|
2017-07-18 10:35:12 +05:30
|
|
|
"value_field" : "total_monthly_sales"
|
|
|
|
}
|
2013-12-13 15:33:40 +05:30
|
|
|
}
|
2015-02-25 12:04:49 +05:30
|
|
|
}
|
2017-04-26 18:25:54 +05:30
|
|
|
|
2017-07-18 10:35:12 +05:30
|
|
|
doctype = [d for d in notifications.get('for_doctype')]
|
2017-04-26 18:25:54 +05:30
|
|
|
for doc in frappe.get_all('DocType',
|
|
|
|
fields= ["name"], filters = {"name": ("not in", doctype), 'is_submittable': 1}):
|
2017-07-18 10:35:12 +05:30
|
|
|
notifications["for_doctype"][doc.name] = {"docstatus": 0}
|
2017-04-26 18:25:54 +05:30
|
|
|
|
2017-07-18 10:35:12 +05:30
|
|
|
return notifications
|