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
|
|
|
|
|
2021-09-02 16:44:59 +05:30
|
|
|
|
2017-04-26 18:25:54 +05:30
|
|
|
import frappe
|
2013-12-13 15:33:40 +05:30
|
|
|
|
2021-09-02 16:44:59 +05:30
|
|
|
|
2013-12-13 15:33:40 +05:30
|
|
|
def get_notification_config():
|
2022-03-28 18:52:46 +05:30
|
|
|
notifications = {
|
|
|
|
"for_doctype": {
|
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},
|
2022-03-28 18:52:46 +05:30
|
|
|
"Sales Order": {"status": ("not in", ("Completed", "Closed")), "docstatus": ("<", 2)},
|
2015-03-02 13:01:39 +05:30
|
|
|
"Journal Entry": {"docstatus": 0},
|
2022-03-28 18:52:46 +05:30
|
|
|
"Sales Invoice": {"outstanding_amount": (">", 0), "docstatus": ("<", 2)},
|
|
|
|
"Purchase Invoice": {"outstanding_amount": (">", 0), "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"},
|
2022-03-28 18:52:46 +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",)),
|
2022-03-28 18:52:46 +05:30
|
|
|
"per_ordered": ("<", 100),
|
2016-02-27 16:24:34 +05:30
|
|
|
},
|
2022-03-28 18:52:46 +05:30
|
|
|
"Request for Quotation": {"docstatus": 0},
|
2016-04-11 17:34:25 +05:30
|
|
|
"Supplier Quotation": {"docstatus": 0},
|
2022-03-28 18:52:46 +05:30
|
|
|
"Purchase Order": {"status": ("not in", ("Completed", "Closed")), "docstatus": ("<", 2)},
|
|
|
|
"Purchase Receipt": {"status": ("not in", ("Completed", "Closed")), "docstatus": ("<", 2)},
|
|
|
|
"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"},
|
2022-03-28 18:52:46 +05:30
|
|
|
"Patient Encounter": {"docstatus": 0},
|
2017-07-18 10:35:12 +05:30
|
|
|
},
|
|
|
|
"targets": {
|
|
|
|
"Company": {
|
2022-03-28 18:52:46 +05:30
|
|
|
"filters": {"monthly_sales_target": (">", 0)},
|
|
|
|
"target_field": "monthly_sales_target",
|
|
|
|
"value_field": "total_monthly_sales",
|
2017-07-18 10:35:12 +05:30
|
|
|
}
|
2022-03-28 18:52:46 +05:30
|
|
|
},
|
2015-02-25 12:04:49 +05:30
|
|
|
}
|
2017-04-26 18:25:54 +05:30
|
|
|
|
2022-03-28 18:52:46 +05:30
|
|
|
doctype = [d for d in notifications.get("for_doctype")]
|
|
|
|
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
|