From 7cbbd68176680aa62ba1249fea799337d2ddbf81 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 20 May 2020 12:55:34 +0530 Subject: [PATCH] fix: CRM module dashboard and onboarding --- erpnext/crm/dashboard_fixtures.py | 135 +++++++++--------- erpnext/crm/desk_page/crm/crm.json | 8 +- erpnext/crm/module_onboarding/crm/crm.json | 11 +- .../create_and_send_quotation.json | 4 +- .../create_lead/create_lead.json | 4 +- .../create_opportunity.json | 4 +- .../introduction_to_crm.json | 2 + .../start_campaign/start_campaign.json | 17 --- 8 files changed, 89 insertions(+), 96 deletions(-) delete mode 100644 erpnext/crm/onboarding_step/start_campaign/start_campaign.json diff --git a/erpnext/crm/dashboard_fixtures.py b/erpnext/crm/dashboard_fixtures.py index 5b1ac9bf5e..16904b3429 100644 --- a/erpnext/crm/dashboard_fixtures.py +++ b/erpnext/crm/dashboard_fixtures.py @@ -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" }] \ No newline at end of file diff --git a/erpnext/crm/desk_page/crm/crm.json b/erpnext/crm/desk_page/crm/crm.json index 80d3d18de9..2fc4582917 100644 --- a/erpnext/crm/desk_page/crm/crm.json +++ b/erpnext/crm/desk_page/crm/crm.json @@ -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" } ] } \ No newline at end of file diff --git a/erpnext/crm/module_onboarding/crm/crm.json b/erpnext/crm/module_onboarding/crm/crm.json index 9129c2625a..694763f7c7 100644 --- a/erpnext/crm/module_onboarding/crm/crm.json +++ b/erpnext/crm/module_onboarding/crm/crm.json @@ -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 diff --git a/erpnext/crm/onboarding_step/create_and_send_quotation/create_and_send_quotation.json b/erpnext/crm/onboarding_step/create_and_send_quotation/create_and_send_quotation.json index 0997017933..a6edfd7e53 100644 --- a/erpnext/crm/onboarding_step/create_and_send_quotation/create_and_send_quotation.json +++ b/erpnext/crm/onboarding_step/create_and_send_quotation/create_and_send_quotation.json @@ -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 } \ No newline at end of file diff --git a/erpnext/crm/onboarding_step/create_lead/create_lead.json b/erpnext/crm/onboarding_step/create_lead/create_lead.json index b1076e0bf9..47a45d70a8 100644 --- a/erpnext/crm/onboarding_step/create_lead/create_lead.json +++ b/erpnext/crm/onboarding_step/create_lead/create_lead.json @@ -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 } \ No newline at end of file diff --git a/erpnext/crm/onboarding_step/create_opportunity/create_opportunity.json b/erpnext/crm/onboarding_step/create_opportunity/create_opportunity.json index 20949a435b..231cf17bb5 100644 --- a/erpnext/crm/onboarding_step/create_opportunity/create_opportunity.json +++ b/erpnext/crm/onboarding_step/create_opportunity/create_opportunity.json @@ -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 } \ No newline at end of file diff --git a/erpnext/crm/onboarding_step/introduction_to_crm/introduction_to_crm.json b/erpnext/crm/onboarding_step/introduction_to_crm/introduction_to_crm.json index c923a77e1b..552ade0fdd 100644 --- a/erpnext/crm/onboarding_step/introduction_to_crm/introduction_to_crm.json +++ b/erpnext/crm/onboarding_step/introduction_to_crm/introduction_to_crm.json @@ -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" } \ No newline at end of file diff --git a/erpnext/crm/onboarding_step/start_campaign/start_campaign.json b/erpnext/crm/onboarding_step/start_campaign/start_campaign.json deleted file mode 100644 index 53c3becea3..0000000000 --- a/erpnext/crm/onboarding_step/start_campaign/start_campaign.json +++ /dev/null @@ -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" -} \ No newline at end of file