fix: CRM module dashboard and onboarding

This commit is contained in:
Nabin Hait 2020-05-20 12:55:34 +05:30
parent 189be3c68b
commit 7cbbd68176
8 changed files with 89 additions and 96 deletions

View File

@ -2,6 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe, erpnext, json
from frappe import _
def get_data():
return frappe._dict({
@ -16,19 +17,19 @@ def get_dashboards():
"name": "CRM",
"dashboard_name": "CRM",
"charts": [
{ "chart": "Lead", "width": "Full" },
{ "chart": "Opportunity", "width": "Full"},
{ "chart": "Campaign", "width": "Half" },
{ "chart": "Opportunities Won", "width": "Half" },
{ "chart": "Territory Wise Opportunity", "width": "Half"},
{ "chart": "Incoming Leads", "width": "Full" },
{ "chart": "Opportunity Trends", "width": "Full"},
{ "chart": "Won Opportunities", "width": "Full" },
{ "chart": "Territory Wise Opportunity Count", "width": "Half"},
{ "chart": "Territory Wise Sales", "width": "Half"},
{ "chart": "Qualified For Call", "width": "Full"},
{ "chart": "Opportunities via Campaigns", "width": "Half" },
{ "chart": "Lead Source", "width": "Half"}
],
"cards": [
{ "card": "New Lead" },
{ "card": "New Opportunity" },
{ "card": "Won Opportunity" },
{ "card": "New Lead (Last 1 Month)" },
{ "card": "New Opportunity (Last 1 Month)" },
{ "card": "Won Opportunity (Last 1 Month)" },
{ "card": "Open Opportunity"},
]
}]
@ -46,11 +47,11 @@ def get_charts():
company = get_company_for_dashboards()
return [{
"name": "Lead",
"name": "Incoming Leads",
"doctype": "Dashboard Chart",
"time_interval": "Yearly",
"chart_type": "Count",
"chart_name": "Lead",
"chart_name": _("Incoming Leads"),
"timespan": "Last Quarter",
"time_interval": "Weekly",
"document_type": "Lead",
@ -62,11 +63,11 @@ def get_charts():
"type": "Bar"
},
{
"name": "Opportunity",
"name": "Opportunity Trends",
"doctype": "Dashboard Chart",
"time_interval": "Yearly",
"chart_type": "Count",
"chart_name": "Opportunity",
"chart_name": _("Opportunity Trends"),
"timespan": "Last Quarter",
"time_interval": "Weekly",
"document_type": "Opportunity",
@ -78,28 +79,25 @@ def get_charts():
"type": "Bar"
},
{
"name": "Campaign",
"name": "Opportunities via Campaigns",
"chart_name": _("Opportunities via Campaigns"),
"doctype": "Dashboard Chart",
"time_interval": "Yearly",
"chart_type": "Count",
"chart_name": "Campaign",
"timespan": "Last Year",
"time_interval": "Monthly",
"document_type": "Campaign",
"based_on": "creation",
"chart_type": "Group By",
"group_by_type": "Count",
"group_by_based_on": "campaign",
"document_type": "Opportunity",
'is_public': 1,
'timeseries': 1,
"owner": "Administrator",
"filters_json": json.dumps([["Opportunity", "company", "=", company, False]]),
"type": "Line",
"color": "#428b46"
"type": "Pie"
},
{
"name": "Opportunities Won",
"name": "Won Opportunities",
"doctype": "Dashboard Chart",
"time_interval": "Yearly",
"chart_type": "Count",
"chart_name": "Opportunities Won",
"chart_name": _("Won Opportunities"),
"timespan": "Last Year",
"time_interval": "Monthly",
"document_type": "Opportunity",
@ -107,20 +105,25 @@ def get_charts():
'is_public': 1,
'timeseries': 1,
"owner": "Administrator",
"filters_json": json.dumps([["Opportunity", "company", "=", company, False],["Opportunity", "sales_stage", "=", "Converted", False]]),
"filters_json": json.dumps([
["Opportunity", "company", "=", company, False],
["Opportunity", "status", "=", "Converted", False]]),
"type": "Bar"
},
{
"name": "Territory Wise Opportunity",
"name": "Territory Wise Opportunity Count",
"doctype": "Dashboard Chart",
"chart_type": "Group By",
"group_by_type": "Count",
"group_by_based_on": "territory",
"chart_name": "Territory Wise Opportunity",
"chart_name": _("Territory Wise Opportunity Count"),
"document_type": "Opportunity",
'is_public': 1,
"filters_json": json.dumps([
["Opportunity", "company", "=", company, False]
]),
"owner": "Administrator",
"type": "Line"
"type": "Donut"
},
{
"name": "Territory Wise Sales",
@ -128,31 +131,16 @@ def get_charts():
"chart_type": "Group By",
"group_by_type": "Sum",
"group_by_based_on": "territory",
"chart_name": "Territory Wise Sales",
"chart_name": _("Territory Wise Sales"),
"aggregate_function_based_on": "opportunity_amount",
"document_type": "Opportunity",
'is_public': 1,
"owner": "Administrator",
"filters_json": json.dumps([["Opportunity", "company", "=", company, False],["Opportunity", "sales_stage", "=", "Converted", False]]),
"type": "Bar",
"color": "#7575ff"
},
{
"name": "Qualified For Call",
"doctype": "Dashboard Chart",
"time_interval": "Yearly",
"chart_type": "Count",
"chart_name": "Qualified For Call",
"timespan": "Last Quarter",
"time_interval": "Weekly",
"document_type": "Opportunity",
"based_on": "modified",
'is_public': 1,
'timeseries': 1,
"owner": "Administrator",
"filters_json": json.dumps([["Opportunity", "company", "=", company, False],["Opportunity", "sales_stage", "=", "Qualification", False]]),
"type": "Line",
"color": "#fff168"
"filters_json": json.dumps([
["Opportunity", "company", "=", company, False],
["Opportunity", "status", "=", "Converted", False]
]),
"type": "Donut"
},
{
"name": "Lead Source",
@ -160,44 +148,55 @@ def get_charts():
"chart_type": "Group By",
"group_by_type": "Count",
"group_by_based_on": "source",
"chart_name": "Lead Source",
"chart_name": _("Lead Source"),
"document_type": "Lead",
'is_public': 1,
"owner": "Administrator",
"type": "Donut"
"type": "Pie"
}]
def get_number_cards():
return [{
"doctype": "Number Card",
"document_type": "Lead",
"name": "New Lead",
"filters_json": json.dumps([["Lead","status","=","Lead",False]]),
"name": "New Lead (Last 1 Month)",
"filters_json": json.dumps([["Lead","creation","Previous","1 month",False]]),
"function": "Count",
"is_public": 1,
"label": "New Lead",
"label": _("New Lead (Last 1 Month)"),
"show_percentage_stats": 1,
"stats_time_interval": "Daily"
},
{
"doctype": "Number Card",
"document_type": "Opportunity",
"name": "New Opportunity",
"name": "New Opportunity (Last 1 Month)",
"filters_json": json.dumps([["Opportunity","creation","Previous","1 month",False]]),
"function": "Count",
"is_public": 1,
"label": _("New Opportunity (Last 1 Month)"),
"show_percentage_stats": 1,
"stats_time_interval": "Daily"
},
{
"doctype": "Number Card",
"document_type": "Opportunity",
"name": "Won Opportunity (Last 1 Month)",
"filters_json": json.dumps([["Opportunity","creation","Previous","1 month",False]]),
"function": "Count",
"is_public": 1,
"label": _("Won Opportunity (Last 1 Month)"),
"show_percentage_stats": 1,
"stats_time_interval": "Daily"
},
{
"doctype": "Number Card",
"document_type": "Opportunity",
"name": "Open Opportunity",
"filters_json": json.dumps([["Opportunity","status","=","Open",False]]),
"function": "Count",
"is_public": 1,
"label": "New Opportunity",
"show_percentage_stats": 1,
"stats_time_interval": "Daily"
},
{
"doctype": "Number Card",
"document_type": "Opportunity",
"name": "Won Opportunity",
"filters_json": json.dumps([["Opportunity","status","=","Converted",False]]),
"function": "Count",
"is_public": 1,
"label": "Won Opportunity",
"label": _("Open Opportunity"),
"show_percentage_stats": 1,
"stats_time_interval": "Daily"
}]

View File

@ -38,10 +38,11 @@
"docstatus": 0,
"doctype": "Desk Page",
"extends_another_page": 0,
"hide_custom": 0,
"idx": 0,
"is_standard": 1,
"label": "CRM",
"modified": "2020-05-14 17:20:07.636751",
"modified": "2020-05-20 12:11:36.250491",
"modified_by": "Administrator",
"module": "CRM",
"name": "CRM",
@ -73,6 +74,11 @@
"label": "Sales Analytics",
"link_to": "Sales Analytics",
"type": "Report"
},
{
"label": "CRM Dashboard",
"link_to": "CRM",
"type": "Dashboard"
}
]
}

View File

@ -4,10 +4,10 @@
"role": "Sales Master Manager"
},
{
"role": "Administrator"
"role": "Sales Manager"
},
{
"role": "Sales Manager"
"role": "Sales User"
}
],
"creation": "2020-05-09 23:42:50.901548",
@ -16,7 +16,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/CRM",
"idx": 0,
"is_complete": 0,
"modified": "2020-05-14 17:41:11.083917",
"modified": "2020-05-20 12:53:47.029412",
"modified_by": "Administrator",
"module": "CRM",
"name": "CRM",
@ -25,9 +25,6 @@
{
"step": "Introduction to CRM"
},
{
"step": "Start Campaign"
},
{
"step": "Create Lead"
},
@ -38,7 +35,7 @@
"step": "Create and Send Quotation"
}
],
"subtitle": "Campaign, Lead, Opportunity, Customer and more",
"subtitle": "Lead, Opportunity, Customer and more",
"success_message": "CRM Module is all setup!",
"title": "Let's Setup Your CRM",
"user_can_dismiss": 1

View File

@ -13,5 +13,7 @@
"name": "Create and Send Quotation",
"owner": "Administrator",
"reference_document": "Quotation",
"title": "Create and Send Quotation"
"show_full_form": 0,
"title": "Create and Send Quotation",
"validate_action": 0
}

View File

@ -13,5 +13,7 @@
"name": "Create Lead",
"owner": "Administrator",
"reference_document": "Lead",
"title": "Create Lead"
"show_full_form": 0,
"title": "Create Lead",
"validate_action": 0
}

View File

@ -13,5 +13,7 @@
"name": "Create Opportunity",
"owner": "Administrator",
"reference_document": "Opportunity",
"title": "Create Opportunity"
"show_full_form": 0,
"title": "Create Opportunity",
"validate_action": 0
}

View File

@ -12,6 +12,8 @@
"modified_by": "Administrator",
"name": "Introduction to CRM",
"owner": "Administrator",
"show_full_form": 0,
"title": "Introduction to CRM",
"validate_action": 0,
"video_url": "https://www.youtube.com/watch?v=o9XCSZHJfpA"
}

View File

@ -1,17 +0,0 @@
{
"action": "Create Entry",
"creation": "2020-05-09 23:38:10.284957",
"docstatus": 0,
"doctype": "Onboarding Step",
"idx": 0,
"is_complete": 0,
"is_mandatory": 0,
"is_single": 0,
"is_skipped": 0,
"modified": "2020-05-14 17:28:54.285958",
"modified_by": "Administrator",
"name": "Start Campaign",
"owner": "Administrator",
"reference_document": "Campaign",
"title": "Start Campaign"
}