2015-03-03 09:25:30 +00:00
|
|
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
2013-12-13 10:03:40 +00:00
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
2017-04-26 12:55:54 +00:00
|
|
|
import frappe
|
2013-12-13 10:03:40 +00:00
|
|
|
|
|
|
|
def get_notification_config():
|
2017-07-18 05:05:12 +00:00
|
|
|
notifications = { "for_doctype":
|
2013-12-13 10:03:40 +00:00
|
|
|
{
|
2015-03-02 07:31:39 +00:00
|
|
|
"Issue": {"status": "Open"},
|
|
|
|
"Warranty Claim": {"status": "Open"},
|
2017-03-09 12:41:11 +00:00
|
|
|
"Task": {"status": ("in", ("Open", "Overdue"))},
|
2015-07-17 09:33:18 +00:00
|
|
|
"Project": {"status": "Open"},
|
2016-04-14 12:00:40 +00:00
|
|
|
"Item": {"total_projected_qty": ("<", 0)},
|
2015-03-02 07:31:39 +00:00
|
|
|
"Lead": {"status": "Open"},
|
|
|
|
"Contact": {"status": "Open"},
|
2015-04-13 11:28:47 +00:00
|
|
|
"Opportunity": {"status": "Open"},
|
|
|
|
"Quotation": {"docstatus": 0},
|
2015-10-02 07:12:48 +00:00
|
|
|
"Sales Order": {
|
2016-02-22 10:54:23 +00:00
|
|
|
"status": ("not in", ("Completed", "Closed")),
|
2015-10-02 07:12:48 +00:00
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2015-03-02 07:31:39 +00:00
|
|
|
"Journal Entry": {"docstatus": 0},
|
2016-09-05 09:05:23 +00:00
|
|
|
"Sales Invoice": {
|
2017-01-30 06:59:54 +00:00
|
|
|
"outstanding_amount": (">", 0),
|
|
|
|
"docstatus": ("<", 2)
|
2016-09-05 09:05:23 +00:00
|
|
|
},
|
|
|
|
"Purchase Invoice": {
|
2017-01-30 06:59:54 +00:00
|
|
|
"outstanding_amount": (">", 0),
|
2016-09-05 09:05:23 +00:00
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2016-11-04 19:44:29 +00:00
|
|
|
"Payment Entry": {"docstatus": 0},
|
2015-03-02 07:31:39 +00:00
|
|
|
"Leave Application": {"status": "Open"},
|
|
|
|
"Expense Claim": {"approval_status": "Draft"},
|
|
|
|
"Job Applicant": {"status": "Open"},
|
2016-09-05 09:05:23 +00:00
|
|
|
"Delivery Note": {
|
|
|
|
"status": ("not in", ("Completed", "Closed")),
|
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2015-03-02 07:31:39 +00:00
|
|
|
"Stock Entry": {"docstatus": 0},
|
2016-02-27 10:54:34 +00:00
|
|
|
"Material Request": {
|
2016-03-07 14:05:34 +00:00
|
|
|
"docstatus": ("<", 2),
|
2016-02-27 10:54:34 +00:00
|
|
|
"status": ("not in", ("Stopped",)),
|
|
|
|
"per_ordered": ("<", 100)
|
|
|
|
},
|
2016-04-11 12:04:25 +00:00
|
|
|
"Request for Quotation": { "docstatus": 0 },
|
|
|
|
"Supplier Quotation": {"docstatus": 0},
|
2015-10-02 07:12:48 +00:00
|
|
|
"Purchase Order": {
|
2016-02-22 10:54:23 +00:00
|
|
|
"status": ("not in", ("Completed", "Closed")),
|
2015-10-02 07:12:48 +00:00
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2016-09-05 09:05:23 +00:00
|
|
|
"Purchase Receipt": {
|
|
|
|
"status": ("not in", ("Completed", "Closed")),
|
|
|
|
"docstatus": ("<", 2)
|
|
|
|
},
|
2016-04-14 12:00:40 +00:00
|
|
|
"Production Order": { "status": ("in", ("Draft", "Not Started", "In Process")) },
|
2015-03-02 07:31:39 +00:00
|
|
|
"BOM": {"docstatus": 0},
|
2017-09-13 07:22:30 +00:00
|
|
|
|
|
|
|
"Timesheet": {"status": "Draft"},
|
|
|
|
|
|
|
|
"Lab Test": {"docstatus": 0},
|
|
|
|
"Sample Collection": {"docstatus": 0},
|
|
|
|
"Patient Appointment": {"status": "Open"},
|
|
|
|
"Consultation": {"docstatus": 0}
|
2017-07-18 05:05:12 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
"targets": {
|
|
|
|
"Company": {
|
2017-09-04 05:44:04 +00:00
|
|
|
"filters" : { "monthly_sales_target": ( ">", 0 ) },
|
|
|
|
"target_field" : "monthly_sales_target",
|
2017-07-18 05:05:12 +00:00
|
|
|
"value_field" : "total_monthly_sales"
|
|
|
|
}
|
2013-12-13 10:03:40 +00:00
|
|
|
}
|
2015-02-25 06:34:49 +00:00
|
|
|
}
|
2017-04-26 12:55:54 +00:00
|
|
|
|
2017-07-18 05:05:12 +00:00
|
|
|
doctype = [d for d in notifications.get('for_doctype')]
|
2017-04-26 12:55:54 +00:00
|
|
|
for doc in frappe.get_all('DocType',
|
|
|
|
fields= ["name"], filters = {"name": ("not in", doctype), 'is_submittable': 1}):
|
2017-07-18 05:05:12 +00:00
|
|
|
notifications["for_doctype"][doc.name] = {"docstatus": 0}
|
2017-04-26 12:55:54 +00:00
|
|
|
|
2017-07-18 05:05:12 +00:00
|
|
|
return notifications
|