From 2b9bcb1a1c33f8d4dd62edc9dc08b90d726eae32 Mon Sep 17 00:00:00 2001 From: Aryan Kaushik Date: Thu, 31 Oct 2024 19:48:23 +0000 Subject: [PATCH 01/37] feat: use Industry Type instead of CRM Industry --- crm/fcrm/doctype/crm_deal/crm_deal.json | 2 +- crm/fcrm/doctype/crm_industry/__init__.py | 0 crm/fcrm/doctype/crm_industry/crm_industry.js | 8 --- .../doctype/crm_industry/crm_industry.json | 60 ------------------- crm/fcrm/doctype/crm_industry/crm_industry.py | 9 --- .../doctype/crm_industry/test_crm_industry.py | 9 --- crm/fcrm/doctype/crm_lead/crm_lead.json | 2 +- .../crm_organization/crm_organization.json | 2 +- .../crm_organization/crm_organization.py | 2 +- crm/fcrm/workspace/frappe_crm/frappe_crm.json | 2 +- crm/install.py | 14 ----- 11 files changed, 5 insertions(+), 105 deletions(-) delete mode 100644 crm/fcrm/doctype/crm_industry/__init__.py delete mode 100644 crm/fcrm/doctype/crm_industry/crm_industry.js delete mode 100644 crm/fcrm/doctype/crm_industry/crm_industry.json delete mode 100644 crm/fcrm/doctype/crm_industry/crm_industry.py delete mode 100644 crm/fcrm/doctype/crm_industry/test_crm_industry.py diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 34a22e35a..f1ff8dd3a 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -290,7 +290,7 @@ "fieldname": "industry", "fieldtype": "Link", "label": "Industry", - "options": "CRM Industry" + "options": "Industry Type" }, { "fieldname": "person_section", diff --git a/crm/fcrm/doctype/crm_industry/__init__.py b/crm/fcrm/doctype/crm_industry/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/crm/fcrm/doctype/crm_industry/crm_industry.js b/crm/fcrm/doctype/crm_industry/crm_industry.js deleted file mode 100644 index 1489970c6..000000000 --- a/crm/fcrm/doctype/crm_industry/crm_industry.js +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -// For license information, please see license.txt - -// frappe.ui.form.on("CRM Industry", { -// refresh(frm) { - -// }, -// }); diff --git a/crm/fcrm/doctype/crm_industry/crm_industry.json b/crm/fcrm/doctype/crm_industry/crm_industry.json deleted file mode 100644 index d3d15a711..000000000 --- a/crm/fcrm/doctype/crm_industry/crm_industry.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "actions": [], - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:industry", - "creation": "2023-07-24 19:40:31.980882", - "default_view": "List", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "industry" - ], - "fields": [ - { - "fieldname": "industry", - "fieldtype": "Data", - "label": "Industry", - "unique": 1 - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2024-01-19 21:57:02.025918", - "modified_by": "Administrator", - "module": "FCRM", - "name": "CRM Industry", - "naming_rule": "By fieldname", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales User", - "share": 1, - "write": 1 - }, - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Manager", - "share": 1, - "write": 1 - } - ], - "quick_entry": 1, - "sort_field": "modified", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_industry/crm_industry.py b/crm/fcrm/doctype/crm_industry/crm_industry.py deleted file mode 100644 index cbafacd94..000000000 --- a/crm/fcrm/doctype/crm_industry/crm_industry.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -# import frappe -from frappe.model.document import Document - - -class CRMIndustry(Document): - pass diff --git a/crm/fcrm/doctype/crm_industry/test_crm_industry.py b/crm/fcrm/doctype/crm_industry/test_crm_industry.py deleted file mode 100644 index 16d87b134..000000000 --- a/crm/fcrm/doctype/crm_industry/test_crm_industry.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors -# See license.txt - -# import frappe -from frappe.tests import UnitTestCase - - -class TestCRMIndustry(UnitTestCase): - pass diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.json b/crm/fcrm/doctype/crm_lead/crm_lead.json index 786c03a53..399ae14d6 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.json +++ b/crm/fcrm/doctype/crm_lead/crm_lead.json @@ -156,7 +156,7 @@ "fieldname": "industry", "fieldtype": "Link", "label": "Industry", - "options": "CRM Industry" + "options": "Industry Type" }, { "fieldname": "image", diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.json b/crm/fcrm/doctype/crm_organization/crm_organization.json index 34252d1c6..886725372 100644 --- a/crm/fcrm/doctype/crm_organization/crm_organization.json +++ b/crm/fcrm/doctype/crm_organization/crm_organization.json @@ -55,7 +55,7 @@ "fieldname": "industry", "fieldtype": "Link", "label": "Industry", - "options": "CRM Industry" + "options": "Industry Type" }, { "fieldname": "territory", diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.py b/crm/fcrm/doctype/crm_organization/crm_organization.py index 471d0f512..b21a3d837 100644 --- a/crm/fcrm/doctype/crm_organization/crm_organization.py +++ b/crm/fcrm/doctype/crm_organization/crm_organization.py @@ -25,7 +25,7 @@ def default_list_data(): 'label': 'Industry', 'type': 'Link', 'key': 'industry', - 'options': 'CRM Industry', + 'options': 'Industry Type', 'width': '14rem', }, { diff --git a/crm/fcrm/workspace/frappe_crm/frappe_crm.json b/crm/fcrm/workspace/frappe_crm/frappe_crm.json index 543e49a8c..40682eb83 100644 --- a/crm/fcrm/workspace/frappe_crm/frappe_crm.json +++ b/crm/fcrm/workspace/frappe_crm/frappe_crm.json @@ -124,7 +124,7 @@ "color": "Grey", "doc_view": "List", "label": "Industries", - "link_to": "CRM Industry", + "link_to": "Industry Type", "stats_filter": "[]", "type": "DocType" } diff --git a/crm/install.py b/crm/install.py index 594b1ea5f..1a8da8ec6 100644 --- a/crm/install.py +++ b/crm/install.py @@ -16,7 +16,6 @@ def after_install(force=False): add_default_fields_layout(force) add_property_setter() add_email_template_custom_fields() - add_default_industries() add_default_lead_sources() frappe.db.commit() @@ -217,19 +216,6 @@ def add_email_template_custom_fields(): frappe.clear_cache(doctype="Email Template") - -def add_default_industries(): - industries = ["Accounting", "Advertising", "Aerospace", "Agriculture", "Airline", "Apparel & Accessories", "Automotive", "Banking", "Biotechnology", "Broadcasting", "Brokerage", "Chemical", "Computer", "Consulting", "Consumer Products", "Cosmetics", "Defense", "Department Stores", "Education", "Electronics", "Energy", "Entertainment & Leisure, Executive Search", "Financial Services", "Food", "Beverage & Tobacco", "Grocery", "Health Care", "Internet Publishing", "Investment Banking", "Legal", "Manufacturing", "Motion Picture & Video", "Music", "Newspaper Publishers", "Online Auctions", "Pension Funds", "Pharmaceuticals", "Private Equity", "Publishing", "Real Estate", "Retail & Wholesale", "Securities & Commodity Exchanges", "Service", "Soap & Detergent", "Software", "Sports", "Technology", "Telecommunications", "Television", "Transportation", "Venture Capital"] - - for industry in industries: - if frappe.db.exists("CRM Industry", industry): - continue - - doc = frappe.new_doc("CRM Industry") - doc.industry = industry - doc.insert() - - def add_default_lead_sources(): lead_sources = ["Existing Customer", "Reference", "Advertisement", "Cold Calling", "Exhibition", "Supplier Reference", "Mass Mailing", "Customer's Vendor", "Campaign", "Walk In"] From b5646787ddd005b1f72ceaf0e95289d043a9c1e7 Mon Sep 17 00:00:00 2001 From: Aryan Kaushik Date: Thu, 31 Oct 2024 20:03:39 +0000 Subject: [PATCH 02/37] feat: use ERP Next Holiday and Holiday List --- crm/fcrm/doctype/crm_holiday/__init__.py | 0 crm/fcrm/doctype/crm_holiday/crm_holiday.json | 57 -------- crm/fcrm/doctype/crm_holiday/crm_holiday.py | 9 -- crm/fcrm/doctype/crm_holiday_list/__init__.py | 0 .../crm_holiday_list/crm_holiday_list.js | 8 -- .../crm_holiday_list/crm_holiday_list.json | 123 ------------------ .../crm_holiday_list/crm_holiday_list.py | 9 -- .../crm_holiday_list/test_crm_holiday_list.py | 9 -- .../crm_service_level_agreement.json | 2 +- .../crm_service_level_agreement.py | 2 +- 10 files changed, 2 insertions(+), 217 deletions(-) delete mode 100644 crm/fcrm/doctype/crm_holiday/__init__.py delete mode 100644 crm/fcrm/doctype/crm_holiday/crm_holiday.json delete mode 100644 crm/fcrm/doctype/crm_holiday/crm_holiday.py delete mode 100644 crm/fcrm/doctype/crm_holiday_list/__init__.py delete mode 100644 crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.js delete mode 100644 crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.json delete mode 100644 crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.py delete mode 100644 crm/fcrm/doctype/crm_holiday_list/test_crm_holiday_list.py diff --git a/crm/fcrm/doctype/crm_holiday/__init__.py b/crm/fcrm/doctype/crm_holiday/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/crm/fcrm/doctype/crm_holiday/crm_holiday.json b/crm/fcrm/doctype/crm_holiday/crm_holiday.json deleted file mode 100644 index fc0f24f39..000000000 --- a/crm/fcrm/doctype/crm_holiday/crm_holiday.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "actions": [], - "allow_rename": 1, - "creation": "2023-12-14 11:16:15.476366", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "date", - "column_break_xzyo", - "weekly_off", - "section_break_zenz", - "description" - ], - "fields": [ - { - "fieldname": "date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Date", - "reqd": 1 - }, - { - "fieldname": "column_break_xzyo", - "fieldtype": "Column Break" - }, - { - "default": "0", - "fieldname": "weekly_off", - "fieldtype": "Check", - "label": "Weekly Off" - }, - { - "fieldname": "section_break_zenz", - "fieldtype": "Section Break" - }, - { - "fieldname": "description", - "fieldtype": "Text Editor", - "in_list_view": 1, - "label": "Description", - "reqd": 1 - } - ], - "index_web_pages_for_search": 1, - "istable": 1, - "links": [], - "modified": "2023-12-14 11:17:41.745419", - "modified_by": "Administrator", - "module": "FCRM", - "name": "CRM Holiday", - "owner": "Administrator", - "permissions": [], - "sort_field": "modified", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_holiday/crm_holiday.py b/crm/fcrm/doctype/crm_holiday/crm_holiday.py deleted file mode 100644 index d77b735dc..000000000 --- a/crm/fcrm/doctype/crm_holiday/crm_holiday.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -# import frappe -from frappe.model.document import Document - - -class CRMHoliday(Document): - pass diff --git a/crm/fcrm/doctype/crm_holiday_list/__init__.py b/crm/fcrm/doctype/crm_holiday_list/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.js b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.js deleted file mode 100644 index 914d43de6..000000000 --- a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.js +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -// For license information, please see license.txt - -// frappe.ui.form.on("CRM Holiday List", { -// refresh(frm) { - -// }, -// }); diff --git a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.json b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.json deleted file mode 100644 index 066f12eed..000000000 --- a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "actions": [], - "allow_rename": 1, - "autoname": "field:holiday_list_name", - "creation": "2023-12-14 11:09:12.876640", - "doctype": "DocType", - "engine": "InnoDB", - "field_order": [ - "holiday_list_name", - "from_date", - "to_date", - "column_break_qwqc", - "total_holidays", - "add_weekly_holidays_section", - "weekly_off", - "add_to_holidays", - "holidays_section", - "holidays", - "clear_table" - ], - "fields": [ - { - "fieldname": "holiday_list_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Holiday List Name", - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "from_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "From Date", - "reqd": 1 - }, - { - "fieldname": "to_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "To Date", - "reqd": 1 - }, - { - "fieldname": "column_break_qwqc", - "fieldtype": "Column Break" - }, - { - "fieldname": "total_holidays", - "fieldtype": "Int", - "label": "Total Holidays" - }, - { - "fieldname": "add_weekly_holidays_section", - "fieldtype": "Section Break", - "label": "Add Weekly Holidays" - }, - { - "fieldname": "weekly_off", - "fieldtype": "Select", - "label": "Weekly Off", - "options": "\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday" - }, - { - "fieldname": "add_to_holidays", - "fieldtype": "Button", - "label": "Add to Holidays" - }, - { - "fieldname": "holidays_section", - "fieldtype": "Section Break", - "label": "Holidays" - }, - { - "fieldname": "clear_table", - "fieldtype": "Button", - "label": "Clear Table" - }, - { - "fieldname": "holidays", - "fieldtype": "Table", - "label": "Holidays", - "options": "CRM Holiday" - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2024-01-19 21:54:54.809445", - "modified_by": "Administrator", - "module": "FCRM", - "name": "CRM Holiday List", - "naming_rule": "By fieldname", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales User", - "share": 1, - "write": 1 - }, - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Manager", - "share": 1, - "write": 1 - } - ], - "sort_field": "modified", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.py b/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.py deleted file mode 100644 index 45c8b1015..000000000 --- a/crm/fcrm/doctype/crm_holiday_list/crm_holiday_list.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -# import frappe -from frappe.model.document import Document - - -class CRMHolidayList(Document): - pass diff --git a/crm/fcrm/doctype/crm_holiday_list/test_crm_holiday_list.py b/crm/fcrm/doctype/crm_holiday_list/test_crm_holiday_list.py deleted file mode 100644 index ee90dc8a4..000000000 --- a/crm/fcrm/doctype/crm_holiday_list/test_crm_holiday_list.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors -# See license.txt - -# import frappe -from frappe.tests import UnitTestCase - - -class TestCRMHolidayList(UnitTestCase): - pass diff --git a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.json b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.json index 81fe90c9b..f6993e52d 100644 --- a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.json +++ b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.json @@ -110,7 +110,7 @@ "fieldname": "holiday_list", "fieldtype": "Link", "label": "Holiday List", - "options": "CRM Holiday List" + "options": "Holiday List" } ], "index_web_pages_for_search": 1, diff --git a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py index d8f3f6698..6d95520cc 100644 --- a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py +++ b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py @@ -219,7 +219,7 @@ def get_holidays(self): res = [] if not self.holiday_list: return res - holiday_list = frappe.get_doc("CRM Holiday List", self.holiday_list) + holiday_list = frappe.get_doc("Holiday List", self.holiday_list) for row in holiday_list.holidays: res.append(row.date) return res From 2b934857a058e01e7a9eeb81adc5da0116ef1bc8 Mon Sep 17 00:00:00 2001 From: Aryan Kaushik Date: Thu, 31 Oct 2024 20:09:27 +0000 Subject: [PATCH 03/37] feat: use ERP Next territory --- crm/fcrm/doctype/crm_deal/crm_deal.json | 2 +- crm/fcrm/doctype/crm_lead/crm_lead.json | 2 +- .../crm_organization/crm_organization.json | 2 +- crm/fcrm/doctype/crm_territory/__init__.py | 0 .../doctype/crm_territory/crm_territory.js | 8 -- .../doctype/crm_territory/crm_territory.json | 129 ------------------ .../doctype/crm_territory/crm_territory.py | 9 -- .../crm_territory/test_crm_territory.py | 9 -- crm/fcrm/workspace/frappe_crm/frappe_crm.json | 2 +- 9 files changed, 4 insertions(+), 159 deletions(-) delete mode 100644 crm/fcrm/doctype/crm_territory/__init__.py delete mode 100644 crm/fcrm/doctype/crm_territory/crm_territory.js delete mode 100644 crm/fcrm/doctype/crm_territory/crm_territory.json delete mode 100644 crm/fcrm/doctype/crm_territory/crm_territory.py delete mode 100644 crm/fcrm/doctype/crm_territory/test_crm_territory.py diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index f1ff8dd3a..20037fa5d 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -217,7 +217,7 @@ "fieldname": "territory", "fieldtype": "Link", "label": "Territory", - "options": "CRM Territory" + "options": "Territory" }, { "fieldname": "source", diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.json b/crm/fcrm/doctype/crm_lead/crm_lead.json index 399ae14d6..8e124436b 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.json +++ b/crm/fcrm/doctype/crm_lead/crm_lead.json @@ -272,7 +272,7 @@ "fieldname": "territory", "fieldtype": "Link", "label": "Territory", - "options": "CRM Territory" + "options": "Territory" }, { "fieldname": "log_tab", diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.json b/crm/fcrm/doctype/crm_organization/crm_organization.json index 886725372..b12283091 100644 --- a/crm/fcrm/doctype/crm_organization/crm_organization.json +++ b/crm/fcrm/doctype/crm_organization/crm_organization.json @@ -61,7 +61,7 @@ "fieldname": "territory", "fieldtype": "Link", "label": "Territory", - "options": "CRM Territory" + "options": "Territory" }, { "fieldname": "currency", diff --git a/crm/fcrm/doctype/crm_territory/__init__.py b/crm/fcrm/doctype/crm_territory/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/crm/fcrm/doctype/crm_territory/crm_territory.js b/crm/fcrm/doctype/crm_territory/crm_territory.js deleted file mode 100644 index 568e9c4c7..000000000 --- a/crm/fcrm/doctype/crm_territory/crm_territory.js +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors -// For license information, please see license.txt - -// frappe.ui.form.on("CRM Territory", { -// refresh(frm) { - -// }, -// }); diff --git a/crm/fcrm/doctype/crm_territory/crm_territory.json b/crm/fcrm/doctype/crm_territory/crm_territory.json deleted file mode 100644 index 91e3b09cb..000000000 --- a/crm/fcrm/doctype/crm_territory/crm_territory.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "actions": [], - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:territory_name", - "creation": "2024-01-04 18:52:58.872535", - "doctype": "DocType", - "engine": "InnoDB", - "field_order": [ - "territory_name", - "column_break_mckp", - "territory_manager", - "section_break_qhaf", - "old_parent", - "parent_crm_territory", - "column_break_pypy", - "lft", - "rgt", - "is_group" - ], - "fields": [ - { - "fieldname": "territory_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Territory Name", - "reqd": 1, - "unique": 1 - }, - { - "default": "0", - "fieldname": "is_group", - "fieldtype": "Check", - "label": "Is Group" - }, - { - "fieldname": "column_break_pypy", - "fieldtype": "Column Break" - }, - { - "fieldname": "territory_manager", - "fieldtype": "Link", - "label": "Territory Manager", - "options": "User" - }, - { - "fieldname": "lft", - "fieldtype": "Int", - "hidden": 1, - "label": "Left", - "no_copy": 1, - "read_only": 1 - }, - { - "fieldname": "rgt", - "fieldtype": "Int", - "hidden": 1, - "label": "Right", - "no_copy": 1, - "read_only": 1 - }, - { - "default": "0", - "fieldname": "is_group", - "fieldtype": "Check", - "label": "Is Group" - }, - { - "fieldname": "old_parent", - "fieldtype": "Link", - "label": "Old Parent", - "options": "CRM Territory" - }, - { - "fieldname": "parent_crm_territory", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Parent CRM Territory", - "options": "CRM Territory" - }, - { - "fieldname": "column_break_mckp", - "fieldtype": "Column Break" - }, - { - "fieldname": "section_break_qhaf", - "fieldtype": "Section Break" - } - ], - "index_web_pages_for_search": 1, - "is_tree": 1, - "links": [], - "modified": "2024-01-19 21:53:53.451891", - "modified_by": "Administrator", - "module": "FCRM", - "name": "CRM Territory", - "naming_rule": "By fieldname", - "nsm_parent_field": "parent_crm_territory", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales User", - "share": 1, - "write": 1 - }, - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Manager", - "share": 1, - "write": 1 - } - ], - "sort_field": "modified", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_territory/crm_territory.py b/crm/fcrm/doctype/crm_territory/crm_territory.py deleted file mode 100644 index d08f3bee4..000000000 --- a/crm/fcrm/doctype/crm_territory/crm_territory.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -# import frappe -from frappe.model.document import Document - - -class CRMTerritory(Document): - pass diff --git a/crm/fcrm/doctype/crm_territory/test_crm_territory.py b/crm/fcrm/doctype/crm_territory/test_crm_territory.py deleted file mode 100644 index c1315d940..000000000 --- a/crm/fcrm/doctype/crm_territory/test_crm_territory.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and Contributors -# See license.txt - -# import frappe -from frappe.tests import UnitTestCase - - -class TestCRMTerritory(UnitTestCase): - pass diff --git a/crm/fcrm/workspace/frappe_crm/frappe_crm.json b/crm/fcrm/workspace/frappe_crm/frappe_crm.json index 40682eb83..e57b8586a 100644 --- a/crm/fcrm/workspace/frappe_crm/frappe_crm.json +++ b/crm/fcrm/workspace/frappe_crm/frappe_crm.json @@ -68,7 +68,7 @@ "color": "Grey", "doc_view": "Tree", "label": "Territories", - "link_to": "CRM Territory", + "link_to": "Territory", "stats_filter": "[]", "type": "DocType" }, From b613ff08544dbc879379d8b41b14d11e2fc7564f Mon Sep 17 00:00:00 2001 From: Aryan Kaushik Date: Thu, 31 Oct 2024 20:48:42 +0000 Subject: [PATCH 04/37] feat: use ERP Next lead source instead of CRM lead source --- crm/fcrm/doctype/crm_deal/crm_deal.json | 2 +- crm/fcrm/doctype/crm_lead/crm_lead.json | 2 +- crm/fcrm/doctype/crm_lead_source/__init__.py | 0 .../crm_lead_source/crm_lead_source.js | 8 --- .../crm_lead_source/crm_lead_source.json | 68 ------------------- .../crm_lead_source/crm_lead_source.py | 9 --- .../crm_lead_source/test_crm_lead_source.py | 9 --- crm/fcrm/workspace/frappe_crm/frappe_crm.json | 2 +- crm/install.py | 12 ---- 9 files changed, 3 insertions(+), 109 deletions(-) delete mode 100644 crm/fcrm/doctype/crm_lead_source/__init__.py delete mode 100644 crm/fcrm/doctype/crm_lead_source/crm_lead_source.js delete mode 100644 crm/fcrm/doctype/crm_lead_source/crm_lead_source.json delete mode 100644 crm/fcrm/doctype/crm_lead_source/crm_lead_source.py delete mode 100644 crm/fcrm/doctype/crm_lead_source/test_crm_lead_source.py diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 20037fa5d..57a7f744f 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -223,7 +223,7 @@ "fieldname": "source", "fieldtype": "Link", "label": "Source", - "options": "CRM Lead Source" + "options": "Lead Source" }, { "fieldname": "no_of_employees", diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.json b/crm/fcrm/doctype/crm_lead/crm_lead.json index 8e124436b..4e86b2348 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.json +++ b/crm/fcrm/doctype/crm_lead/crm_lead.json @@ -150,7 +150,7 @@ "fieldname": "source", "fieldtype": "Link", "label": "Source", - "options": "CRM Lead Source" + "options": "Lead Source" }, { "fieldname": "industry", diff --git a/crm/fcrm/doctype/crm_lead_source/__init__.py b/crm/fcrm/doctype/crm_lead_source/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/crm/fcrm/doctype/crm_lead_source/crm_lead_source.js b/crm/fcrm/doctype/crm_lead_source/crm_lead_source.js deleted file mode 100644 index 2330b7835..000000000 --- a/crm/fcrm/doctype/crm_lead_source/crm_lead_source.js +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -// For license information, please see license.txt - -// frappe.ui.form.on("CRM Lead Source", { -// refresh(frm) { - -// }, -// }); diff --git a/crm/fcrm/doctype/crm_lead_source/crm_lead_source.json b/crm/fcrm/doctype/crm_lead_source/crm_lead_source.json deleted file mode 100644 index 23aea6f62..000000000 --- a/crm/fcrm/doctype/crm_lead_source/crm_lead_source.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "actions": [], - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:source_name", - "creation": "2023-07-24 19:47:01.063203", - "default_view": "List", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "source_name", - "details" - ], - "fields": [ - { - "fieldname": "source_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Source Name", - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "details", - "fieldtype": "Text Editor", - "label": "Details" - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2024-01-19 21:56:04.702254", - "modified_by": "Administrator", - "module": "FCRM", - "name": "CRM Lead Source", - "naming_rule": "By fieldname", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales User", - "share": 1, - "write": 1 - }, - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Manager", - "share": 1, - "write": 1 - } - ], - "quick_entry": 1, - "sort_field": "modified", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_lead_source/crm_lead_source.py b/crm/fcrm/doctype/crm_lead_source/crm_lead_source.py deleted file mode 100644 index 48487b406..000000000 --- a/crm/fcrm/doctype/crm_lead_source/crm_lead_source.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -# import frappe -from frappe.model.document import Document - - -class CRMLeadSource(Document): - pass diff --git a/crm/fcrm/doctype/crm_lead_source/test_crm_lead_source.py b/crm/fcrm/doctype/crm_lead_source/test_crm_lead_source.py deleted file mode 100644 index 31d379179..000000000 --- a/crm/fcrm/doctype/crm_lead_source/test_crm_lead_source.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors -# See license.txt - -# import frappe -from frappe.tests import UnitTestCase - - -class TestCRMLeadSource(UnitTestCase): - pass diff --git a/crm/fcrm/workspace/frappe_crm/frappe_crm.json b/crm/fcrm/workspace/frappe_crm/frappe_crm.json index e57b8586a..c472b79fb 100644 --- a/crm/fcrm/workspace/frappe_crm/frappe_crm.json +++ b/crm/fcrm/workspace/frappe_crm/frappe_crm.json @@ -100,7 +100,7 @@ "color": "Grey", "doc_view": "List", "label": "Lead Sources", - "link_to": "CRM Lead Source", + "link_to": "Lead Source", "stats_filter": "[]", "type": "DocType" }, diff --git a/crm/install.py b/crm/install.py index 1a8da8ec6..f129cca16 100644 --- a/crm/install.py +++ b/crm/install.py @@ -16,7 +16,6 @@ def after_install(force=False): add_default_fields_layout(force) add_property_setter() add_email_template_custom_fields() - add_default_lead_sources() frappe.db.commit() def add_default_lead_statuses(): @@ -215,14 +214,3 @@ def add_email_template_custom_fields(): ) frappe.clear_cache(doctype="Email Template") - -def add_default_lead_sources(): - lead_sources = ["Existing Customer", "Reference", "Advertisement", "Cold Calling", "Exhibition", "Supplier Reference", "Mass Mailing", "Customer's Vendor", "Campaign", "Walk In"] - - for source in lead_sources: - if frappe.db.exists("CRM Lead Source", source): - continue - - doc = frappe.new_doc("CRM Lead Source") - doc.source_name = source - doc.insert() From 40413606a55d122ccc75975450ff56d78db8a857 Mon Sep 17 00:00:00 2001 From: Aryan Kaushik Date: Thu, 31 Oct 2024 21:00:23 +0000 Subject: [PATCH 05/37] feat: use ERP Next service day instead of CRM service day --- crm/fcrm/doctype/crm_service_day/__init__.py | 0 .../crm_service_day/crm_service_day.json | 59 ------------------- .../crm_service_day/crm_service_day.py | 9 --- .../crm_service_level_agreement.json | 2 +- 4 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 crm/fcrm/doctype/crm_service_day/__init__.py delete mode 100644 crm/fcrm/doctype/crm_service_day/crm_service_day.json delete mode 100644 crm/fcrm/doctype/crm_service_day/crm_service_day.py diff --git a/crm/fcrm/doctype/crm_service_day/__init__.py b/crm/fcrm/doctype/crm_service_day/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/crm/fcrm/doctype/crm_service_day/crm_service_day.json b/crm/fcrm/doctype/crm_service_day/crm_service_day.json deleted file mode 100644 index ddca98836..000000000 --- a/crm/fcrm/doctype/crm_service_day/crm_service_day.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "actions": [], - "allow_rename": 1, - "creation": "2023-12-04 16:07:20.400084", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "workday", - "section_break_uegc", - "start_time", - "column_break_maie", - "end_time" - ], - "fields": [ - { - "fieldname": "workday", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Workday", - "options": "Monday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday", - "reqd": 1 - }, - { - "fieldname": "section_break_uegc", - "fieldtype": "Section Break" - }, - { - "fieldname": "start_time", - "fieldtype": "Time", - "in_list_view": 1, - "label": "Start Time", - "reqd": 1 - }, - { - "fieldname": "column_break_maie", - "fieldtype": "Column Break" - }, - { - "fieldname": "end_time", - "fieldtype": "Time", - "in_list_view": 1, - "label": "End Time", - "reqd": 1 - } - ], - "index_web_pages_for_search": 1, - "istable": 1, - "links": [], - "modified": "2023-12-04 16:09:22.928308", - "modified_by": "Administrator", - "module": "FCRM", - "name": "CRM Service Day", - "owner": "Administrator", - "permissions": [], - "sort_field": "modified", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_service_day/crm_service_day.py b/crm/fcrm/doctype/crm_service_day/crm_service_day.py deleted file mode 100644 index 724a720db..000000000 --- a/crm/fcrm/doctype/crm_service_day/crm_service_day.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -# import frappe -from frappe.model.document import Document - - -class CRMServiceDay(Document): - pass diff --git a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.json b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.json index f6993e52d..dd1a4c2bf 100644 --- a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.json +++ b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.json @@ -84,7 +84,7 @@ "fieldname": "working_hours", "fieldtype": "Table", "label": "Working Hours", - "options": "CRM Service Day", + "options": "Service Day", "reqd": 1 }, { From e4c43798c12d6b1032e8337c0b822c52a710d122 Mon Sep 17 00:00:00 2001 From: Aryan Kaushik Date: Thu, 31 Oct 2024 23:44:03 +0000 Subject: [PATCH 06/37] feat: use customer instead of organization --- crm/api/comment.py | 2 +- crm/api/contact.py | 2 +- crm/api/session.py | 8 +- crm/api/todo.py | 2 +- crm/fcrm/custom/customer.json | 550 ++++++++++++++++++ crm/fcrm/doctype/crm_deal/crm_deal.json | 28 +- crm/fcrm/doctype/crm_deal/crm_deal.py | 38 +- crm/fcrm/doctype/crm_lead/crm_lead.json | 10 +- crm/fcrm/doctype/crm_lead/crm_lead.py | 54 +- crm/fcrm/doctype/crm_organization/__init__.py | 0 .../crm_organization/crm_organization.js | 8 - .../crm_organization/crm_organization.json | 117 ---- .../crm_organization/crm_organization.py | 54 -- .../crm_organization/test_crm_organization.py | 9 - .../erpnext_crm_settings.py | 20 +- crm/fcrm/workspace/frappe_crm/frappe_crm.json | 6 +- crm/hooks.py | 1 + crm/install.py | 22 +- crm/overrides/contact.py | 2 +- crm/overrides/customer.py | 111 ++++ .../v1_0/update_deal_quick_entry_layout.py | 2 +- frontend/src/components/CommunicationArea.vue | 4 +- ...rganizationsIcon.vue => CustomersIcon.vue} | 0 .../src/components/Layouts/AppSidebar.vue | 12 +- ...ionsListView.vue => CustomersListView.vue} | 8 +- .../components/ListViews/DealsListView.vue | 2 +- .../components/ListViews/LeadsListView.vue | 2 +- .../src/components/Mobile/MobileSidebar.vue | 12 +- .../src/components/Modals/ContactModal.vue | 4 +- ...rganizationModal.vue => CustomerModal.vue} | 92 +-- frontend/src/components/Modals/DealModal.vue | 20 +- frontend/src/components/Modals/LeadModal.vue | 2 +- .../src/components/Modals/QuickEntryModal.vue | 2 +- .../components/Settings/SidePanelModal.vue | 2 +- frontend/src/pages/Contact.vue | 18 +- frontend/src/pages/Contacts.vue | 6 +- .../pages/{Organization.vue => Customer.vue} | 118 ++-- .../{Organizations.vue => Customers.vue} | 84 +-- frontend/src/pages/Deal.vue | 54 +- frontend/src/pages/Deals.vue | 14 +- frontend/src/pages/Lead.vue | 34 +- frontend/src/pages/Leads.vue | 8 +- frontend/src/pages/MobileContact.vue | 18 +- ...ileOrganization.vue => MobileCustomer.vue} | 110 ++-- frontend/src/pages/MobileDeal.vue | 40 +- frontend/src/pages/MobileLead.vue | 34 +- frontend/src/router.js | 14 +- frontend/src/stores/customers.js | 34 ++ frontend/src/stores/organizations.js | 34 -- 49 files changed, 1151 insertions(+), 677 deletions(-) create mode 100644 crm/fcrm/custom/customer.json delete mode 100644 crm/fcrm/doctype/crm_organization/__init__.py delete mode 100644 crm/fcrm/doctype/crm_organization/crm_organization.js delete mode 100644 crm/fcrm/doctype/crm_organization/crm_organization.json delete mode 100644 crm/fcrm/doctype/crm_organization/crm_organization.py delete mode 100644 crm/fcrm/doctype/crm_organization/test_crm_organization.py create mode 100644 crm/overrides/customer.py rename frontend/src/components/Icons/{OrganizationsIcon.vue => CustomersIcon.vue} (100%) rename frontend/src/components/ListViews/{OrganizationsListView.vue => CustomersListView.vue} (97%) rename frontend/src/components/Modals/{OrganizationModal.vue => CustomerModal.vue} (76%) rename frontend/src/pages/{Organization.vue => Customer.vue} (84%) rename frontend/src/pages/{Organizations.vue => Customers.vue} (53%) rename frontend/src/pages/{MobileOrganization.vue => MobileCustomer.vue} (84%) create mode 100644 frontend/src/stores/customers.js delete mode 100644 frontend/src/stores/organizations.js diff --git a/crm/api/comment.py b/crm/api/comment.py index 7d78f0d4e..a51c561ed 100644 --- a/crm/api/comment.py +++ b/crm/api/comment.py @@ -24,7 +24,7 @@ def notify_mentions(doc): doctype = doc.reference_doctype if doctype.startswith("CRM "): doctype = doctype[4:].lower() - name = reference_doc.lead_name or name if doctype == "lead" else reference_doc.organization or reference_doc.lead_name or name + name = reference_doc.lead_name or name if doctype == "lead" else reference_doc.customer or reference_doc.lead_name or name notification_text = f"""
{ owner } diff --git a/crm/api/contact.py b/crm/api/contact.py index 65bc06609..b7a5d6140 100644 --- a/crm/api/contact.py +++ b/crm/api/contact.py @@ -88,7 +88,7 @@ def get_linked_deals(contact): d.parent, fields=[ "name", - "organization", + "customer", "currency", "annual_revenue", "status", diff --git a/crm/api/session.py b/crm/api/session.py index 2e2b93758..ed1a2f035 100644 --- a/crm/api/session.py +++ b/crm/api/session.py @@ -78,12 +78,12 @@ def get_lead_contacts(): return lead_contacts @frappe.whitelist() -def get_organizations(): - organizations = frappe.qb.get_query( - "CRM Organization", +def get_customers(): + customers = frappe.qb.get_query( + "Customer", fields=['*'], order_by="name asc", distinct=True, ).run(as_dict=1) - return organizations + return customers diff --git a/crm/api/todo.py b/crm/api/todo.py index f30e19f41..72c0e7e0d 100644 --- a/crm/api/todo.py +++ b/crm/api/todo.py @@ -53,7 +53,7 @@ def get_notification_text(owner, doc, reference_doc, is_cancelled=False): doctype = doctype[4:].lower() if doctype in ["lead", "deal"]: - name = reference_doc.lead_name or name if doctype == "lead" else reference_doc.organization or reference_doc.lead_name or name + name = reference_doc.lead_name or name if doctype == "lead" else reference_doc.customer or reference_doc.lead_name or name if is_cancelled: return f""" diff --git a/crm/fcrm/custom/customer.json b/crm/fcrm/custom/customer.json new file mode 100644 index 000000000..0244acb4b --- /dev/null +++ b/crm/fcrm/custom/customer.json @@ -0,0 +1,550 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-11-04 10:06:03.447626", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_no_of_employees", + "fieldtype": "Select", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 32, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "customer_details", + "is_system_generated": 0, + "is_virtual": 0, + "label": "No. of Employees", + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-11-04 10:06:03.447626", + "modified_by": "Administrator", + "module": null, + "name": "Customer-custom_no_of_employees", + "no_copy": 0, + "non_negative": 0, + "options": "1-10\n11-50\n51-200\n201-500\n501-1000\n1000+", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-11-04 10:06:03.334472", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_annual_revenue", + "fieldtype": "Currency", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 29, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "language", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Annual Revenue", + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-11-04 10:06:03.334472", + "modified_by": "Administrator", + "module": null, + "name": "Customer-custom_annual_revenue", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-10-09 17:05:00.917694", + "default": "Unregistered", + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "gst_category", + "fieldtype": "Select", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_details_column_break", + "is_system_generated": 1, + "is_virtual": 0, + "label": "GST Category", + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-10-09 17:05:00.917694", + "modified_by": "Administrator", + "module": null, + "name": "Customer-gst_category", + "no_copy": 0, + "non_negative": 0, + "options": "Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nDeemed Export\nUIN Holders\nTax Deductor", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-10-09 17:05:00.916629", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "tax_details_column_break", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "pan", + "is_system_generated": 1, + "is_virtual": 0, + "label": null, + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-10-09 17:05:00.916629", + "modified_by": "Administrator", + "module": null, + "name": "Customer-tax_details_column_break", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-10-09 17:05:00.915524", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "gstin", + "fieldtype": "Autocomplete", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_details_section", + "is_system_generated": 1, + "is_virtual": 0, + "label": "GSTIN / UIN", + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-10-09 17:05:00.915524", + "modified_by": "Administrator", + "module": null, + "name": "Customer-gstin", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-10-09 17:05:00.914456", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "tax_details_section", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_withholding_category", + "is_system_generated": 1, + "is_virtual": 0, + "label": "Tax Details", + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-10-09 17:05:00.914456", + "modified_by": "Administrator", + "module": null, + "name": "Customer-tax_details_section", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-10-09 17:05:00.790899", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "pan", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "gstin", + "is_system_generated": 1, + "is_virtual": 0, + "label": "PAN", + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-10-09 17:05:00.790899", + "modified_by": "Administrator", + "module": null, + "name": "Customer-pan", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "eval: doc.gstin", + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Customer", + "links": [ + { + "creation": "2013-06-11 14:26:44", + "custom": 0, + "docstatus": 0, + "group": "Allowed Items", + "hidden": 0, + "idx": 1, + "is_child_table": 0, + "link_doctype": "Party Specific Item", + "link_fieldname": "party", + "modified": "2024-11-04 10:03:40.848367", + "modified_by": "Administrator", + "name": "dc6606f582", + "owner": "Administrator", + "parent": "Customer", + "parent_doctype": null, + "parentfield": "links", + "parenttype": "DocType", + "table_fieldname": null + } + ], + "property_setters": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-11-04 10:06:03.242533", + "default_value": null, + "doc_type": "Customer", + "docstatus": 0, + "doctype_or_field": "DocType", + "field_name": null, + "idx": 0, + "is_system_generated": 0, + "modified": "2024-11-04 10:06:03.242533", + "modified_by": "Administrator", + "module": null, + "name": "Customer-main-field_order", + "owner": "Administrator", + "property": "field_order", + "property_type": "Data", + "row_name": null, + "value": "[\"basic_info\", \"naming_series\", \"salutation\", \"customer_name\", \"customer_type\", \"customer_group\", \"column_break0\", \"territory\", \"gender\", \"lead_name\", \"opportunity_name\", \"account_manager\", \"image\", \"defaults_tab\", \"default_currency\", \"default_bank_account\", \"column_break_14\", \"default_price_list\", \"internal_customer_section\", \"is_internal_customer\", \"represents_company\", \"column_break_70\", \"companies\", \"more_info\", \"market_segment\", \"industry\", \"customer_pos_id\", \"website\", \"language\", \"annual_revenue\", \"column_break_45\", \"customer_details\", \"no_of_employees\", \"dashboard_tab\", \"contact_and_address_tab\", \"address_contacts\", \"address_html\", \"column_break1\", \"contact_html\", \"primary_address_and_contact_detail\", \"column_break_26\", \"customer_primary_address\", \"primary_address\", \"column_break_nwor\", \"customer_primary_contact\", \"mobile_no\", \"email_id\", \"tax_tab\", \"taxation_section\", \"tax_id\", \"column_break_21\", \"tax_category\", \"tax_withholding_category\", \"tax_details_section\", \"gstin\", \"pan\", \"tax_details_column_break\", \"gst_category\", \"accounting_tab\", \"credit_limit_section\", \"payment_terms\", \"credit_limits\", \"default_receivable_accounts\", \"accounts\", \"loyalty_points_tab\", \"loyalty_program\", \"column_break_54\", \"loyalty_program_tier\", \"sales_team_tab\", \"sales_team\", \"sales_team_section\", \"default_sales_partner\", \"column_break_66\", \"default_commission_rate\", \"settings_tab\", \"so_required\", \"dn_required\", \"column_break_53\", \"is_frozen\", \"disabled\", \"portal_users_tab\", \"portal_users\"]" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-11-01 04:21:38.061283", + "default_value": null, + "doc_type": "Customer", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "naming_series", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-11-01 04:21:38.061283", + "modified_by": "Administrator", + "module": null, + "name": "Customer-naming_series-options", + "owner": null, + "property": "options", + "property_type": "Text", + "row_name": null, + "value": "CUST-.YYYY.-" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-10-09 17:06:29.249446", + "default_value": null, + "doc_type": "Customer", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "naming_series", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-10-09 17:06:29.249446", + "modified_by": "Administrator", + "module": null, + "name": "Customer-naming_series-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-10-09 17:06:29.156131", + "default_value": null, + "doc_type": "Customer", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "naming_series", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-10-09 17:06:29.156131", + "modified_by": "Administrator", + "module": null, + "name": "Customer-naming_series-reqd", + "owner": "Administrator", + "property": "reqd", + "property_type": "Check", + "row_name": null, + "value": "0" + } + ], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 57a7f744f..0cad0080f 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -7,9 +7,9 @@ "doctype": "DocType", "engine": "InnoDB", "field_order": [ - "organization_tab", + "customer_tab", "naming_series", - "organization", + "customer", "next_step", "probability", "column_break_ijan", @@ -24,8 +24,8 @@ "source", "column_break_wsde", "lead_name", - "organization_details_section", - "organization_name", + "customer_details_section", + "customer_name", "website", "no_of_employees", "job_title", @@ -59,10 +59,10 @@ ], "fields": [ { - "fieldname": "organization", + "fieldname": "customer", "fieldtype": "Link", - "label": "Organization", - "options": "CRM Organization" + "label": "Customer", + "options": "Customer" }, { "fieldname": "probability", @@ -145,9 +145,9 @@ "options": "CRM Contacts" }, { - "fieldname": "organization_tab", + "fieldname": "customer_tab", "fieldtype": "Tab Break", - "label": "Organization" + "label": "Customer" }, { "fieldname": "sla_tab", @@ -273,14 +273,14 @@ "fieldtype": "Column Break" }, { - "fieldname": "organization_details_section", + "fieldname": "customer_details_section", "fieldtype": "Section Break", - "label": "Organization Details" + "label": "Customer Details" }, { - "fieldname": "organization_name", + "fieldname": "customer_name", "fieldtype": "Data", - "label": "Organization Name" + "label": "Customer Name" }, { "fieldname": "column_break_xbyf", @@ -374,6 +374,6 @@ "sort_field": "modified", "sort_order": "DESC", "states": [], - "title_field": "organization", + "title_field": "customer", "track_changes": 1 } \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index dc18c1331..03575e5b8 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -129,10 +129,10 @@ def apply_sla(self): def default_list_data(): columns = [ { - 'label': 'Organization', + 'label': 'Customer', 'type': 'Link', - 'key': 'organization', - 'options': 'CRM Organization', + 'key': 'customer', + 'options': 'Customer', 'width': '11rem', }, { @@ -174,7 +174,7 @@ def default_list_data(): ] rows = [ "name", - "organization", + "customer", "annual_revenue", "status", "email", @@ -194,7 +194,7 @@ def default_list_data(): def default_kanban_settings(): return { "column_field": "status", - "title_field": "organization", + "title_field": "customer", "kanban_fields": '["annual_revenue", "email", "mobile_no", "_assign", "modified"]' } @@ -228,26 +228,26 @@ def set_primary_contact(deal, contact): deal.save() return True -def create_organization(doc): - if not doc.get("organization_name"): +def create_customer(doc): + if not doc.get("customer_name"): return - existing_organization = frappe.db.exists("CRM Organization", {"organization_name": doc.get("organization_name")}) - if existing_organization: - return existing_organization + existing_customer = frappe.db.exists("Customer", {"customer_name": doc.get("customer_name")}) + if existing_customer: + return existing_customer - organization = frappe.new_doc("CRM Organization") - organization.update( + customer = frappe.new_doc("Customer") + customer.update( { - "organization_name": doc.get("organization_name"), + "customer_name": doc.get("customer_name"), "website": doc.get("website"), "territory": doc.get("territory"), "industry": doc.get("industry"), - "annual_revenue": doc.get("annual_revenue"), + "custom_annual_revenue": doc.get("custom_annual_revenue"), } ) - organization.insert(ignore_permissions=True) - return organization.name + customer.insert(ignore_permissions=True) + return customer.name def contact_exists(doc): email_exist = frappe.db.exists("Contact Email", {"email_id": doc.get("email")}) @@ -272,7 +272,7 @@ def create_contact(doc): "first_name": doc.get("first_name"), "last_name": doc.get("last_name"), "salutation": doc.get("salutation"), - "company_name": doc.get("organization") or doc.get("organization_name"), + "company_name": doc.get("customer") or doc.get("customer_name"), } ) @@ -296,11 +296,11 @@ def create_deal(args): contact = create_contact(args) deal.update({ - "organization": args.get("organization") or create_organization(args), + "customer": args.get("customer") or create_customer(args), "contacts": [{"contact": contact, "is_primary": 1}] if contact else [], }) - args.pop("organization", None) + args.pop("customer", None) deal.update(args) diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.json b/crm/fcrm/doctype/crm_lead/crm_lead.json index 4e86b2348..9a325f561 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.json +++ b/crm/fcrm/doctype/crm_lead/crm_lead.json @@ -11,7 +11,7 @@ "engine": "InnoDB", "field_order": [ "details", - "organization", + "customer", "website", "territory", "industry", @@ -24,7 +24,7 @@ "last_name", "email", "mobile_no", - "organization_tab", + "customer_tab", "section_break_uixv", "naming_series", "lead_name", @@ -177,15 +177,15 @@ "label": "Job Title" }, { - "fieldname": "organization_tab", + "fieldname": "customer_tab", "fieldtype": "Tab Break", "label": "Others", "read_only": 1 }, { - "fieldname": "organization", + "fieldname": "customer", "fieldtype": "Data", - "label": "Organization" + "label": "Customer" }, { "default": "0", diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index 632080a90..4dcaad004 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -43,17 +43,17 @@ def set_full_name(self): def set_lead_name(self): if not self.lead_name: # Check for leads being created through data import - if not self.organization and not self.email and not self.flags.ignore_mandatory: - frappe.throw(_("A Lead requires either a person's name or an organization's name")) - elif self.organization: - self.lead_name = self.organization + if not self.customer and not self.email and not self.flags.ignore_mandatory: + frappe.throw(_("A Lead requires either a person's name or an customer's name")) + elif self.customer: + self.lead_name = self.customer elif self.email: self.lead_name = self.email.split("@")[0] else: self.lead_name = "Unnamed Lead" def set_title(self): - self.title = self.organization or self.lead_name + self.title = self.customer or self.lead_name def validate_email(self): if self.email: @@ -116,7 +116,7 @@ def create_contact(self, throw=True): "salutation": self.salutation, "gender": self.gender, "designation": self.job_title, - "company_name": self.organization, + "company_name": self.customer, "image": self.image or "", } ) @@ -135,26 +135,26 @@ def create_contact(self, throw=True): return contact.name - def create_organization(self): - if not self.organization: + def create_customer(self): + if not self.customer: return - existing_organization = frappe.db.exists("CRM Organization", {"organization_name": self.organization}) - if existing_organization: - return existing_organization + existing_customer = frappe.db.exists("Customer", {"customer_name": self.customer}) + if existing_customer: + return existing_customer - organization = frappe.new_doc("CRM Organization") - organization.update( + customer = frappe.new_doc("Customer") + customer.update( { - "organization_name": self.organization, + "customer_name": self.customer, "website": self.website, "territory": self.territory, "industry": self.industry, - "annual_revenue": self.annual_revenue, + "custom_annual_revenue": self.custom_annual_revenue, } ) - organization.insert(ignore_permissions=True) - return organization.name + customer.insert(ignore_permissions=True) + return customer.name def contact_exists(self, throw=True): email_exist = frappe.db.exists("Contact Email", {"email_id": self.email}) @@ -181,7 +181,7 @@ def contact_exists(self, throw=True): return False - def create_deal(self, contact, organization): + def create_deal(self, contact, customer): deal = frappe.new_doc("CRM Deal") lead_deal_map = { @@ -202,8 +202,8 @@ def create_deal(self, contact, organization): fieldname = lead_deal_map[field.fieldname] if hasattr(deal, fieldname): - if fieldname == "organization": - deal.update({fieldname: organization}) + if fieldname == "customer": + deal.update({fieldname: customer}) else: deal.update({fieldname: self.get(field.fieldname)}) @@ -269,10 +269,10 @@ def default_list_data(): 'width': '12rem', }, { - 'label': 'Organization', + 'label': 'Customer', 'type': 'Link', - 'key': 'organization', - 'options': 'CRM Organization', + 'key': 'customer', + 'options': 'Customer', 'width': '10rem', }, { @@ -309,7 +309,7 @@ def default_list_data(): rows = [ "name", "lead_name", - "organization", + "customer", "status", "email", "mobile_no", @@ -330,7 +330,7 @@ def default_kanban_settings(): return { "column_field": "status", "title_field": "lead_name", - "kanban_fields": '["organization", "email", "mobile_no", "_assign", "modified"]' + "kanban_fields": '["customer", "email", "mobile_no", "_assign", "modified"]' } @@ -347,6 +347,6 @@ def convert_to_deal(lead, doc=None): lead.communication_status = "Replied" lead.save(ignore_permissions=True) contact = lead.create_contact(False) - organization = lead.create_organization() - deal = lead.create_deal(contact, organization) + customer = lead.create_customer() + deal = lead.create_deal(contact, customer) return deal diff --git a/crm/fcrm/doctype/crm_organization/__init__.py b/crm/fcrm/doctype/crm_organization/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.js b/crm/fcrm/doctype/crm_organization/crm_organization.js deleted file mode 100644 index 763952d1f..000000000 --- a/crm/fcrm/doctype/crm_organization/crm_organization.js +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -// For license information, please see license.txt - -// frappe.ui.form.on("CRM Organization", { -// refresh(frm) { - -// }, -// }); diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.json b/crm/fcrm/doctype/crm_organization/crm_organization.json deleted file mode 100644 index b12283091..000000000 --- a/crm/fcrm/doctype/crm_organization/crm_organization.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "actions": [], - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:organization_name", - "creation": "2023-11-03 16:23:59.341751", - "doctype": "DocType", - "engine": "InnoDB", - "field_order": [ - "organization_name", - "no_of_employees", - "currency", - "annual_revenue", - "organization_logo", - "column_break_pnpp", - "website", - "territory", - "industry", - "address" - ], - "fields": [ - { - "fieldname": "organization_name", - "fieldtype": "Data", - "label": "Organization Name", - "unique": 1 - }, - { - "fieldname": "website", - "fieldtype": "Data", - "label": "Website" - }, - { - "fieldname": "organization_logo", - "fieldtype": "Attach Image", - "label": "Organization Logo" - }, - { - "fieldname": "no_of_employees", - "fieldtype": "Select", - "label": "No. of Employees", - "options": "1-10\n11-50\n51-200\n201-500\n501-1000\n1000+" - }, - { - "fieldname": "column_break_pnpp", - "fieldtype": "Column Break" - }, - { - "fieldname": "annual_revenue", - "fieldtype": "Currency", - "label": "Annual Revenue", - "options": "currency" - }, - { - "fieldname": "industry", - "fieldtype": "Link", - "label": "Industry", - "options": "Industry Type" - }, - { - "fieldname": "territory", - "fieldtype": "Link", - "label": "Territory", - "options": "Territory" - }, - { - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "options": "Currency" - }, - { - "fieldname": "address", - "fieldtype": "Link", - "label": "Address", - "options": "Address" - } - ], - "image_field": "organization_logo", - "index_web_pages_for_search": 1, - "links": [], - "modified": "2024-09-17 18:37:10.341062", - "modified_by": "Administrator", - "module": "FCRM", - "name": "CRM Organization", - "naming_rule": "By fieldname", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales User", - "share": 1, - "write": 1 - }, - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Manager", - "share": 1, - "write": 1 - } - ], - "sort_field": "modified", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.py b/crm/fcrm/doctype/crm_organization/crm_organization.py deleted file mode 100644 index b21a3d837..000000000 --- a/crm/fcrm/doctype/crm_organization/crm_organization.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -import frappe -from frappe.model.document import Document - - -class CRMOrganization(Document): - @staticmethod - def default_list_data(): - columns = [ - { - 'label': 'Organization', - 'type': 'Data', - 'key': 'organization_name', - 'width': '16rem', - }, - { - 'label': 'Website', - 'type': 'Data', - 'key': 'website', - 'width': '14rem', - }, - { - 'label': 'Industry', - 'type': 'Link', - 'key': 'industry', - 'options': 'Industry Type', - 'width': '14rem', - }, - { - 'label': 'Annual Revenue', - 'type': 'Currency', - 'key': 'annual_revenue', - 'width': '14rem', - }, - { - 'label': 'Last Modified', - 'type': 'Datetime', - 'key': 'modified', - 'width': '8rem', - }, - ] - rows = [ - "name", - "organization_name", - "organization_logo", - "website", - "industry", - "currency", - "annual_revenue", - "modified", - ] - return {'columns': columns, 'rows': rows} diff --git a/crm/fcrm/doctype/crm_organization/test_crm_organization.py b/crm/fcrm/doctype/crm_organization/test_crm_organization.py deleted file mode 100644 index e80667548..000000000 --- a/crm/fcrm/doctype/crm_organization/test_crm_organization.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors -# See license.txt - -# import frappe -from frappe.tests import UnitTestCase - - -class TestCRMOrganization(UnitTestCase): - pass diff --git a/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py b/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py index 2e15a0118..37e2ee193 100644 --- a/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py +++ b/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py @@ -113,7 +113,7 @@ def get_customer_link(crm_deal): @frappe.whitelist() -def get_quotation_url(crm_deal, organization): +def get_quotation_url(crm_deal, customer): erpnext_crm_settings = frappe.get_single("ERPNext CRM Settings") if not erpnext_crm_settings.enabled: frappe.throw(_("ERPNext is not integrated with the CRM")) @@ -133,18 +133,18 @@ def create_prospect_in_remote_site(crm_deal, erpnext_crm_settings): client = get_erpnext_site_client(erpnext_crm_settings) doc = frappe.get_doc("CRM Deal", crm_deal) contacts = get_contacts(doc) - address = get_organization_address(doc.organization) + address = get_customer_address(doc.customer) return client.post_api("erpnext.crm.frappe_crm_api.create_prospect_against_crm_deal", { - "organization": doc.organization, + "customer": doc.customer, "lead_name": doc.lead_name, - "no_of_employees": doc.no_of_employees, + "custom_no_of_employees": doc.custom_no_of_employees, "deal_owner": doc.deal_owner, "crm_deal": doc.name, "territory": doc.territory, "industry": doc.industry, "website": doc.website, - "annual_revenue": doc.annual_revenue, + "custom_annual_revenue": doc.custom_annual_revenue, "contacts": json.dumps(contacts), "erpnext_company": erpnext_crm_settings.erpnext_company, "address": address.as_dict() if address else None @@ -170,8 +170,8 @@ def get_contacts(doc): }) return contacts -def get_organization_address(organization): - address = frappe.db.get_value("CRM Organization", organization, "address") +def get_customer_address(customer): + address = frappe.db.get_value("Customer", customer, "customer_primary_address") address = frappe.get_doc("Address", address) if address else None if not address: return None @@ -198,9 +198,9 @@ def create_customer_in_erpnext(doc, method): return contacts = get_contacts(doc) - address = get_organization_address(doc.organization) + address = get_customer_address(doc.customer) customer = { - "customer_name": doc.organization, + "customer_name": doc.customer, "customer_group": "All Customer Groups", "customer_type": "Company", "territory": doc.territory, @@ -244,7 +244,7 @@ def get_crm_form_script(): "crm.fcrm.doctype.erpnext_crm_settings.erpnext_crm_settings.get_quotation_url", { crm_deal: doc.name, - organization: doc.organization + customer: doc.customer } ); diff --git a/crm/fcrm/workspace/frappe_crm/frappe_crm.json b/crm/fcrm/workspace/frappe_crm/frappe_crm.json index c472b79fb..8ce1f3b3c 100644 --- a/crm/fcrm/workspace/frappe_crm/frappe_crm.json +++ b/crm/fcrm/workspace/frappe_crm/frappe_crm.json @@ -1,6 +1,6 @@ { "charts": [], - "content": "[{\"id\":\"1nr6UkvDiL\",\"type\":\"header\",\"data\":{\"text\":\"PORTAL\",\"col\":12}},{\"id\":\"1hyi8SysUY\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"CRM Portal Page\",\"col\":3}},{\"id\":\"ktENiGaqXQ\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"VgeWLYOuAS\",\"type\":\"paragraph\",\"data\":{\"text\":\"SHORTCUTS\",\"col\":12}},{\"id\":\"A66FpG-K3T\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Leads\",\"col\":3}},{\"id\":\"n9b6N5ebOj\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Deals\",\"col\":3}},{\"id\":\"sGHTXrludH\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Organizations\",\"col\":3}},{\"id\":\"uXZNCdqxy0\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Contacts\",\"col\":3}},{\"id\":\"v1kkMwlntf\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"SLA\",\"col\":3}},{\"id\":\"WRzt4SMh_b\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Assignment Rule\",\"col\":3}},{\"id\":\"TZ7cULX3Tk\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"zpySv0nGVQ\",\"type\":\"paragraph\",\"data\":{\"text\":\"META\",\"col\":12}},{\"id\":\"fa-uKzobpp\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Lead Statuses\",\"col\":3}},{\"id\":\"hxoZghUHP2\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Deal Statuses\",\"col\":3}},{\"id\":\"HbgghUpc8N\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Lead Sources\",\"col\":3}},{\"id\":\"8cPs7Fohb4\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Industries\",\"col\":3}},{\"id\":\"arT4xZ9HWR\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Territories\",\"col\":3}},{\"id\":\"ApHOcISpiJ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Communication Statuses\",\"col\":3}}]", + "content": "[{\"id\":\"1nr6UkvDiL\",\"type\":\"header\",\"data\":{\"text\":\"PORTAL\",\"col\":12}},{\"id\":\"1hyi8SysUY\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"CRM Portal Page\",\"col\":3}},{\"id\":\"ktENiGaqXQ\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"VgeWLYOuAS\",\"type\":\"paragraph\",\"data\":{\"text\":\"SHORTCUTS\",\"col\":12}},{\"id\":\"A66FpG-K3T\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Leads\",\"col\":3}},{\"id\":\"n9b6N5ebOj\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Deals\",\"col\":3}},{\"id\":\"sGHTXrludH\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Customers\",\"col\":3}},{\"id\":\"uXZNCdqxy0\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Contacts\",\"col\":3}},{\"id\":\"v1kkMwlntf\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"SLA\",\"col\":3}},{\"id\":\"WRzt4SMh_b\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Assignment Rule\",\"col\":3}},{\"id\":\"TZ7cULX3Tk\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"zpySv0nGVQ\",\"type\":\"paragraph\",\"data\":{\"text\":\"META\",\"col\":12}},{\"id\":\"fa-uKzobpp\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Lead Statuses\",\"col\":3}},{\"id\":\"hxoZghUHP2\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Deal Statuses\",\"col\":3}},{\"id\":\"HbgghUpc8N\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Lead Sources\",\"col\":3}},{\"id\":\"8cPs7Fohb4\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Industries\",\"col\":3}},{\"id\":\"arT4xZ9HWR\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Territories\",\"col\":3}},{\"id\":\"ApHOcISpiJ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Communication Statuses\",\"col\":3}}]", "creation": "2023-11-27 13:55:17.090361", "custom_blocks": [], "docstatus": 0, @@ -107,8 +107,8 @@ { "color": "Grey", "doc_view": "List", - "label": "Organizations", - "link_to": "CRM Organization", + "label": "Customers", + "link_to": "Customer", "stats_filter": "[]", "type": "DocType" }, diff --git a/crm/hooks.py b/crm/hooks.py index dfc4c9d75..fcb6ffaf1 100644 --- a/crm/hooks.py +++ b/crm/hooks.py @@ -133,6 +133,7 @@ "Contact": "crm.overrides.contact.CustomContact", "Email Template": "crm.overrides.email_template.CustomEmailTemplate", "User": "crm.overrides.user.CustomUser", + "Customer": "crm.overrides.customer.Customer", } # Document Events diff --git a/crm/install.py b/crm/install.py index f129cca16..2f193a212 100644 --- a/crm/install.py +++ b/crm/install.py @@ -113,19 +113,19 @@ def add_default_fields_layout(force=False): quick_entry_layouts = { "CRM Lead-Quick Entry": { "doctype": "CRM Lead", - "layout": '[{"label":"Person","fields":["salutation","first_name","last_name","email","mobile_no", "gender"],"hideLabel":true},{"label":"Organization","fields":["organization","website","no_of_employees","territory","annual_revenue","industry"],"hideLabel":true,"hideBorder":false},{"label":"Other","columns":2,"fields":["status","lead_owner"],"hideLabel":true,"hideBorder":false}]' + "layout": '[{"label":"Person","fields":["salutation","first_name","last_name","email","mobile_no", "gender"],"hideLabel":true},{"label":"Customer","fields":["customer","website","no_of_employees","territory","annual_revenue","industry"],"hideLabel":true,"hideBorder":false},{"label":"Other","columns":2,"fields":["status","lead_owner"],"hideLabel":true,"hideBorder":false}]' }, "CRM Deal-Quick Entry": { "doctype": "CRM Deal", - "layout": '[{"label": "Select Organization", "fields": ["organization"], "hideLabel": true, "editable": true}, {"label": "Organization Details", "fields": ["organization_name", "website", "no_of_employees", "territory", "annual_revenue", "industry"], "hideLabel": true, "editable": true}, {"label": "Select Contact", "fields": ["contact"], "hideLabel": true, "editable": true}, {"label": "Contact Details", "fields": ["salutation", "first_name", "last_name", "email", "mobile_no", "gender"], "hideLabel": true, "editable": true}, {"label": "Other", "columns": 2, "fields": ["status", "deal_owner"], "hideLabel": true}]' + "layout": '[{"label": "Select Customer", "fields": ["customer"], "hideLabel": true, "editable": true}, {"label": "Customer Details", "fields": ["customer_name", "website", "no_of_employees", "territory", "annual_revenue", "industry"], "hideLabel": true, "editable": true}, {"label": "Select Contact", "fields": ["contact"], "hideLabel": true, "editable": true}, {"label": "Contact Details", "fields": ["salutation", "first_name", "last_name", "email", "mobile_no", "gender"], "hideLabel": true, "editable": true}, {"label": "Other", "columns": 2, "fields": ["status", "deal_owner"], "hideLabel": true}]' }, "Contact-Quick Entry": { "doctype": "Contact", - "layout": '[{"label":"Salutation","columns":1,"fields":["salutation"],"hideLabel":true},{"label":"Full Name","columns":2,"hideBorder":true,"fields":["first_name","last_name"],"hideLabel":true},{"label":"Email","columns":1,"hideBorder":true,"fields":["email_id"],"hideLabel":true},{"label":"Mobile No. & Gender","columns":2,"hideBorder":true,"fields":["mobile_no","gender"],"hideLabel":true},{"label":"Organization","columns":1,"hideBorder":true,"fields":["company_name"],"hideLabel":true},{"label":"Designation","columns":1,"hideBorder":true,"fields":["designation"],"hideLabel":true},{"label":"Address","columns":1,"hideBorder":true,"fields":["address"],"hideLabel":true}]' + "layout": '[{"label":"Salutation","columns":1,"fields":["salutation"],"hideLabel":true},{"label":"Full Name","columns":2,"hideBorder":true,"fields":["first_name","last_name"],"hideLabel":true},{"label":"Email","columns":1,"hideBorder":true,"fields":["email_id"],"hideLabel":true},{"label":"Mobile No. & Gender","columns":2,"hideBorder":true,"fields":["mobile_no","gender"],"hideLabel":true},{"label":"Customer","columns":1,"hideBorder":true,"fields":["company_name"],"hideLabel":true},{"label":"Designation","columns":1,"hideBorder":true,"fields":["designation"],"hideLabel":true},{"label":"Address","columns":1,"hideBorder":true,"fields":["address"],"hideLabel":true}]' }, - "CRM Organization-Quick Entry": { - "doctype": "CRM Organization", - "layout": '[{"label":"Organization Name","columns":1,"fields":["organization_name"],"hideLabel":true},{"label":"Website & Revenue","columns":2,"hideBorder":true,"fields":["website","annual_revenue"],"hideLabel":true},{"label":"Territory","columns":1,"hideBorder":true,"fields":["territory"],"hideLabel":true},{"label":"No of Employees & Industry","columns":2,"hideBorder":true,"fields":["no_of_employees","industry"],"hideLabel":true},{"label":"Address","columns":1,"hideBorder":true,"fields":["address"],"hideLabel":true}]' + "Customer-Quick Entry": { + "doctype": "Customer", + "layout": '[{"label":"Customer Name","columns":1,"fields":["customer_name"],"hideLabel":true},{"label":"Website & Revenue","columns":2,"hideBorder":true,"fields":["website","custom_annual_revenue"],"hideLabel":true},{"label":"Territory","columns":1,"hideBorder":true,"fields":["territory"],"hideLabel":true},{"label":"No of Employees & Industry","columns":2,"hideBorder":true,"fields":["no_of_employees","industry"],"hideLabel":true},{"label":"Address","columns":1,"hideBorder":true,"fields":["customer_primary_address"],"hideLabel":true}]' }, "Address-Quick Entry": { "doctype": "Address", @@ -136,19 +136,19 @@ def add_default_fields_layout(force=False): sidebar_fields_layouts = { "CRM Lead-Side Panel": { "doctype": "CRM Lead", - "layout": '[{"label": "Details", "name": "details", "opened": true, "fields": ["organization", "website", "territory", "industry", "job_title", "source", "lead_owner"]}, {"label": "Person", "name": "person_tab", "opened": true, "fields": ["salutation", "first_name", "last_name", "email", "mobile_no"]}]' + "layout": '[{"label": "Details", "name": "details", "opened": true, "fields": ["customer", "website", "territory", "industry", "job_title", "source", "lead_owner"]}, {"label": "Person", "name": "person_tab", "opened": true, "fields": ["salutation", "first_name", "last_name", "email", "mobile_no"]}]' }, "CRM Deal-Side Panel": { "doctype": "CRM Deal", - "layout": '[{"label":"Contacts","name":"contacts_section","opened":true,"editable":false,"contacts":[]},{"label":"Organization Details","name":"organization_tab","opened":true,"fields":["organization","website","territory","annual_revenue","close_date","probability","next_step","deal_owner"]}]' + "layout": '[{"label":"Contacts","name":"contacts_section","opened":true,"editable":false,"contacts":[]},{"label":"Customer Details","name":"customer_tab","opened":true,"fields":["customer","website","territory","annual_revenue","close_date","probability","next_step","deal_owner"]}]' }, "Contact-Side Panel": { "doctype": "Contact", "layout": '[{"label":"Details","name":"details","opened":true,"fields":["salutation","first_name","last_name","email_id","mobile_no","gender","company_name","designation","address"]}]' }, - "CRM Organization-Side Panel": { - "doctype": "CRM Organization", - "layout": '[{"label":"Details","name":"details","opened":true,"fields":["organization_name","website","territory","industry","no_of_employees","address"]}]' + "Customer-Side Panel": { + "doctype": "Customer", + "layout": '[{"label":"Details","name":"details","opened":true,"fields":["customer_name","website","territory","industry","custom_no_of_employees","customer_primary_address"]}]' }, } diff --git a/crm/overrides/contact.py b/crm/overrides/contact.py index 9845c3982..c229537bc 100644 --- a/crm/overrides/contact.py +++ b/crm/overrides/contact.py @@ -26,7 +26,7 @@ def default_list_data(): 'width': '12rem', }, { - 'label': 'Organization', + 'label': 'Customer', 'type': 'Data', 'key': 'company_name', 'width': '12rem', diff --git a/crm/overrides/customer.py b/crm/overrides/customer.py new file mode 100644 index 000000000..b6da73ae2 --- /dev/null +++ b/crm/overrides/customer.py @@ -0,0 +1,111 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +import frappe +from erpnext.selling.doctype.customer.customer import Customer + +class Customer(Customer): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from erpnext.accounts.doctype.allowed_to_transact_with.allowed_to_transact_with import AllowedToTransactWith + from erpnext.accounts.doctype.party_account.party_account import PartyAccount + from erpnext.selling.doctype.customer_credit_limit.customer_credit_limit import CustomerCreditLimit + from erpnext.selling.doctype.sales_team.sales_team import SalesTeam + from erpnext.utilities.doctype.portal_user.portal_user import PortalUser + from frappe.types import DF + + account_manager: DF.Link | None + accounts: DF.Table[PartyAccount] + companies: DF.Table[AllowedToTransactWith] + credit_limits: DF.Table[CustomerCreditLimit] + customer_details: DF.Text | None + customer_group: DF.Link | None + customer_name: DF.Data + customer_pos_id: DF.Data | None + customer_primary_address: DF.Link | None + customer_primary_contact: DF.Link | None + customer_type: DF.Literal["Company", "Individual", "Proprietorship", "Partnership"] + default_bank_account: DF.Link | None + default_commission_rate: DF.Float + default_currency: DF.Link | None + default_price_list: DF.Link | None + default_sales_partner: DF.Link | None + disabled: DF.Check + dn_required: DF.Check + email_id: DF.ReadOnly | None + gender: DF.Link | None + image: DF.AttachImage | None + industry: DF.Link | None + is_frozen: DF.Check + is_internal_customer: DF.Check + language: DF.Link | None + lead_name: DF.Link | None + loyalty_program: DF.Link | None + loyalty_program_tier: DF.Data | None + market_segment: DF.Link | None + mobile_no: DF.ReadOnly | None + naming_series: DF.Literal["CUST-.YYYY.-"] + opportunity_name: DF.Link | None + payment_terms: DF.Link | None + portal_users: DF.Table[PortalUser] + primary_address: DF.Text | None + represents_company: DF.Link | None + sales_team: DF.Table[SalesTeam] + salutation: DF.Link | None + so_required: DF.Check + tax_category: DF.Link | None + tax_id: DF.Data | None + tax_withholding_category: DF.Link | None + territory: DF.Link | None + website: DF.Data | None + # end: auto-generated types + @staticmethod + def default_list_data(): + columns = [ + { + 'label': 'Customer', + 'type': 'Data', + 'key': 'customer_name', + 'width': '16rem', + }, + { + 'label': 'Website', + 'type': 'Data', + 'key': 'website', + 'width': '14rem', + }, + { + 'label': 'Industry', + 'type': 'Link', + 'key': 'industry', + 'options': 'Industry Type', + 'width': '14rem', + }, + { + 'label': 'Annual Revenue', + 'type': 'Currency', + 'key': 'custom_annual_revenue', + 'width': '14rem', + }, + { + 'label': 'Last Modified', + 'type': 'Datetime', + 'key': 'modified', + 'width': '8rem', + }, + ] + rows = [ + "name", + "customer_name", + "image", + "website", + "industry", + "default_currency", + "custom_annual_revenue", + "modified", + ] + return {'columns': columns, 'rows': rows} \ No newline at end of file diff --git a/crm/patches/v1_0/update_deal_quick_entry_layout.py b/crm/patches/v1_0/update_deal_quick_entry_layout.py index fc52e2acc..067fdefdf 100644 --- a/crm/patches/v1_0/update_deal_quick_entry_layout.py +++ b/crm/patches/v1_0/update_deal_quick_entry_layout.py @@ -9,7 +9,7 @@ def execute(): layout = json.loads(deal) for section in layout: - if section.get("label") in ["Select Organization", "Organization Details", "Select Contact", "Contact Details"]: + if section.get("label") in ["Select Customer", "Customer Details", "Select Contact", "Contact Details"]: section["editable"] = False frappe.db.set_value("CRM Fields Layout", "CRM Deal-Quick Entry", "layout", json.dumps(layout)) \ No newline at end of file diff --git a/frontend/src/components/CommunicationArea.vue b/frontend/src/components/CommunicationArea.vue index 384b75fc0..9ac570cc2 100644 --- a/frontend/src/components/CommunicationArea.vue +++ b/frontend/src/components/CommunicationArea.vue @@ -121,8 +121,8 @@ const subject = computed(() => { let prefix = '' if (doc.value.data?.lead_name) { prefix = doc.value.data.lead_name - } else if (doc.value.data?.organization) { - prefix = doc.value.data.organization + } else if (doc.value.data?.customer) { + prefix = doc.value.data.customer } return `${prefix} (#${doc.value.data.name})` }) diff --git a/frontend/src/components/Icons/OrganizationsIcon.vue b/frontend/src/components/Icons/CustomersIcon.vue similarity index 100% rename from frontend/src/components/Icons/OrganizationsIcon.vue rename to frontend/src/components/Icons/CustomersIcon.vue diff --git a/frontend/src/components/Layouts/AppSidebar.vue b/frontend/src/components/Layouts/AppSidebar.vue index ada04c1dc..28225edc9 100644 --- a/frontend/src/components/Layouts/AppSidebar.vue +++ b/frontend/src/components/Layouts/AppSidebar.vue @@ -100,7 +100,7 @@ import UserDropdown from '@/components/UserDropdown.vue' import LeadsIcon from '@/components/Icons/LeadsIcon.vue' import DealsIcon from '@/components/Icons/DealsIcon.vue' import ContactsIcon from '@/components/Icons/ContactsIcon.vue' -import OrganizationsIcon from '@/components/Icons/OrganizationsIcon.vue' +import CustomersIcon from '@/components/Icons/CustomersIcon.vue' import NoteIcon from '@/components/Icons/NoteIcon.vue' import TaskIcon from '@/components/Icons/TaskIcon.vue' import PhoneIcon from '@/components/Icons/PhoneIcon.vue' @@ -139,9 +139,9 @@ const links = [ to: 'Contacts', }, { - label: 'Organizations', - icon: OrganizationsIcon, - to: 'Organizations', + label: 'Customers', + icon: CustomersIcon, + to: 'Customers', }, { label: 'Notes', @@ -216,8 +216,8 @@ function getIcon(routeName, icon) { return DealsIcon case 'Contacts': return ContactsIcon - case 'Organizations': - return OrganizationsIcon + case 'Customers': + return CustomersIcon case 'Notes': return NoteIcon case 'Call Logs': diff --git a/frontend/src/components/ListViews/OrganizationsListView.vue b/frontend/src/components/ListViews/CustomersListView.vue similarity index 97% rename from frontend/src/components/ListViews/OrganizationsListView.vue rename to frontend/src/components/ListViews/CustomersListView.vue index 6099ba8d0..4f30362c4 100644 --- a/frontend/src/components/ListViews/OrganizationsListView.vue +++ b/frontend/src/components/ListViews/CustomersListView.vue @@ -4,8 +4,8 @@ :rows="rows" :options="{ getRowRoute: (row) => ({ - name: 'Organization', - params: { organizationId: row.name }, + name: 'Customer', + params: { customerId: row.name }, query: { view: route.query.view, viewType: route.params.viewType }, }), selectable: options.selectable, @@ -41,7 +41,7 @@ >