Merge branch 'anupamvs-crm-onboarding' into develop

This commit is contained in:
Nabin Hait 2020-05-20 12:55:59 +05:30
commit e9864aa578
8 changed files with 378 additions and 3 deletions

View File

@ -0,0 +1,202 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe, erpnext, json
from frappe import _
def get_data():
return frappe._dict({
"dashboards": get_dashboards(),
"charts": get_charts(),
"number_cards": get_number_cards()
})
def get_dashboards():
return [{
"doctype": "Dashboard",
"name": "CRM",
"dashboard_name": "CRM",
"charts": [
{ "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": "Opportunities via Campaigns", "width": "Half" },
{ "chart": "Lead Source", "width": "Half"}
],
"cards": [
{ "card": "New Lead (Last 1 Month)" },
{ "card": "New Opportunity (Last 1 Month)" },
{ "card": "Won Opportunity (Last 1 Month)" },
{ "card": "Open Opportunity"},
]
}]
def get_company_for_dashboards():
company = frappe.defaults.get_defaults().company
if company:
return company
else:
company_list = frappe.get_list("Company")
if company_list:
return company_list[0].name
return None
def get_charts():
company = get_company_for_dashboards()
return [{
"name": "Incoming Leads",
"doctype": "Dashboard Chart",
"time_interval": "Yearly",
"chart_type": "Count",
"chart_name": _("Incoming Leads"),
"timespan": "Last Quarter",
"time_interval": "Weekly",
"document_type": "Lead",
"based_on": "creation",
'is_public': 1,
'timeseries': 1,
"owner": "Administrator",
"filters_json": json.dumps([["Opportunity", "company", "=", company, False]]),
"type": "Bar"
},
{
"name": "Opportunity Trends",
"doctype": "Dashboard Chart",
"time_interval": "Yearly",
"chart_type": "Count",
"chart_name": _("Opportunity Trends"),
"timespan": "Last Quarter",
"time_interval": "Weekly",
"document_type": "Opportunity",
"based_on": "creation",
'is_public': 1,
'timeseries': 1,
"owner": "Administrator",
"filters_json": json.dumps([["Opportunity", "company", "=", company, False]]),
"type": "Bar"
},
{
"name": "Opportunities via Campaigns",
"chart_name": _("Opportunities via Campaigns"),
"doctype": "Dashboard Chart",
"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": "Pie"
},
{
"name": "Won Opportunities",
"doctype": "Dashboard Chart",
"time_interval": "Yearly",
"chart_type": "Count",
"chart_name": _("Won Opportunities"),
"timespan": "Last Year",
"time_interval": "Monthly",
"document_type": "Opportunity",
"based_on": "modified",
'is_public': 1,
'timeseries': 1,
"owner": "Administrator",
"filters_json": json.dumps([
["Opportunity", "company", "=", company, False],
["Opportunity", "status", "=", "Converted", False]]),
"type": "Bar"
},
{
"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 Count"),
"document_type": "Opportunity",
'is_public': 1,
"filters_json": json.dumps([
["Opportunity", "company", "=", company, False]
]),
"owner": "Administrator",
"type": "Donut"
},
{
"name": "Territory Wise Sales",
"doctype": "Dashboard Chart",
"chart_type": "Group By",
"group_by_type": "Sum",
"group_by_based_on": "territory",
"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", "status", "=", "Converted", False]
]),
"type": "Donut"
},
{
"name": "Lead Source",
"doctype": "Dashboard Chart",
"chart_type": "Group By",
"group_by_type": "Count",
"group_by_based_on": "source",
"chart_name": _("Lead Source"),
"document_type": "Lead",
'is_public': 1,
"owner": "Administrator",
"type": "Pie"
}]
def get_number_cards():
return [{
"doctype": "Number Card",
"document_type": "Lead",
"name": "New Lead (Last 1 Month)",
"filters_json": json.dumps([["Lead","creation","Previous","1 month",False]]),
"function": "Count",
"is_public": 1,
"label": _("New Lead (Last 1 Month)"),
"show_percentage_stats": 1,
"stats_time_interval": "Daily"
},
{
"doctype": "Number Card",
"document_type": "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": _("Open Opportunity"),
"show_percentage_stats": 1,
"stats_time_interval": "Daily"
}]

View File

@ -27,21 +27,26 @@
}
],
"category": "Modules",
"charts": [],
"charts": [
{
"chart_name": "Territory Wise Sales"
}
],
"creation": "2020-01-23 14:48:30.183272",
"developer_mode_only": 0,
"disable_user_customization": 0,
"docstatus": 0,
"doctype": "Desk Page",
"extends_another_page": 0,
"icon": "",
"hide_custom": 0,
"idx": 0,
"is_standard": 1,
"label": "CRM",
"modified": "2020-04-27 22:32:26.682911",
"modified": "2020-05-20 12:11:36.250491",
"modified_by": "Administrator",
"module": "CRM",
"name": "CRM",
"onboarding": "CRM",
"owner": "Administrator",
"pin_to_bottom": 0,
"pin_to_top": 0,
@ -69,6 +74,11 @@
"label": "Sales Analytics",
"link_to": "Sales Analytics",
"type": "Report"
},
{
"label": "CRM Dashboard",
"link_to": "CRM",
"type": "Dashboard"
}
]
}

View File

@ -0,0 +1,42 @@
{
"allow_roles": [
{
"role": "Sales Master Manager"
},
{
"role": "Sales Manager"
},
{
"role": "Sales User"
}
],
"creation": "2020-05-09 23:42:50.901548",
"docstatus": 0,
"doctype": "Module Onboarding",
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/CRM",
"idx": 0,
"is_complete": 0,
"modified": "2020-05-20 12:53:47.029412",
"modified_by": "Administrator",
"module": "CRM",
"name": "CRM",
"owner": "Administrator",
"steps": [
{
"step": "Introduction to CRM"
},
{
"step": "Create Lead"
},
{
"step": "Create Opportunity"
},
{
"step": "Create and Send Quotation"
}
],
"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

@ -0,0 +1,45 @@
{
"allow_roles": [
{
"role": "Sales Master Manager"
},
{
"role": "Administrator"
},
{
"role": "Sales Manager"
}
],
"creation": "2020-05-09 23:42:50.901548",
"docstatus": 0,
"doctype": "Onboarding",
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/CRM",
"idx": 0,
"is_complete": 0,
"modified": "2020-05-09 23:42:50.901548",
"modified_by": "Administrator",
"module": "CRM",
"name": "CRM",
"owner": "Administrator",
"steps": [
{
"step": "Introduction to CRM"
},
{
"step": "Start Campaign"
},
{
"step": "Create Lead"
},
{
"step": "Convert Lead to Customer"
},
{
"step": "Create and Send Quotation"
}
],
"subtitle": "Campaign, Lead, Opportunity, Customer and more",
"success_message": "CRM Module is all setup!",
"title": "Let's Setup Your CRM",
"user_can_dismiss": 1
}

View File

@ -0,0 +1,19 @@
{
"action": "Create Entry",
"creation": "2020-05-09 23:42:46.592075",
"docstatus": 0,
"doctype": "Onboarding Step",
"idx": 0,
"is_complete": 0,
"is_mandatory": 0,
"is_single": 0,
"is_skipped": 0,
"modified": "2020-05-14 17:30:07.887411",
"modified_by": "Administrator",
"name": "Create and Send Quotation",
"owner": "Administrator",
"reference_document": "Quotation",
"show_full_form": 0,
"title": "Create and Send Quotation",
"validate_action": 0
}

View File

@ -0,0 +1,19 @@
{
"action": "Create Entry",
"creation": "2020-05-09 23:40:25.192503",
"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:36.441387",
"modified_by": "Administrator",
"name": "Create Lead",
"owner": "Administrator",
"reference_document": "Lead",
"show_full_form": 0,
"title": "Create Lead",
"validate_action": 0
}

View File

@ -0,0 +1,19 @@
{
"action": "Create Entry",
"creation": "2020-05-14 17:38:27.496696",
"docstatus": 0,
"doctype": "Onboarding Step",
"idx": 0,
"is_complete": 0,
"is_mandatory": 0,
"is_single": 0,
"is_skipped": 0,
"modified": "2020-05-14 17:38:27.496696",
"modified_by": "Administrator",
"name": "Create Opportunity",
"owner": "Administrator",
"reference_document": "Opportunity",
"show_full_form": 0,
"title": "Create Opportunity",
"validate_action": 0
}

View File

@ -0,0 +1,19 @@
{
"action": "Watch Video",
"creation": "2020-05-09 23:37:08.926812",
"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:16.448676",
"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"
}