Sales Goal by Company (#9723)

* [sales goal] in company; dashboard, graph, notifs, wiz

* [test] target notifications

* cache past year monthly sales of every company daily, patch

* [minor] query fixes

* update sales goal docs
This commit is contained in:
Prateeksha Singh
2017-07-18 10:35:12 +05:30
committed by Makarand Bauskar
parent e2d0d0a0c1
commit e012e24423
18 changed files with 2199 additions and 1861 deletions

View File

@@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe
def get_notification_config():
notification_for_doctype = { "for_doctype":
notifications = { "for_doctype":
{
"Issue": {"status": "Open"},
"Warranty Claim": {"status": "Open"},
@@ -56,12 +56,20 @@ def get_notification_config():
"Production Order": { "status": ("in", ("Draft", "Not Started", "In Process")) },
"BOM": {"docstatus": 0},
"Timesheet": {"status": "Draft"}
},
"targets": {
"Company": {
"filters" : { "sales_target": ( ">", 0 ) },
"target_field" : "sales_target",
"value_field" : "total_monthly_sales"
}
}
}
doctype = [d for d in notification_for_doctype.get('for_doctype')]
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}):
notification_for_doctype["for_doctype"][doc.name] = {"docstatus": 0}
notifications["for_doctype"][doc.name] = {"docstatus": 0}
return notification_for_doctype
return notifications