diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 6277ab23..25f521cb 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -10,6 +10,7 @@ "organization_tab", "organization", "website", + "territory", "annual_revenue", "close_date", "probability", @@ -208,11 +209,18 @@ "fieldtype": "Link", "label": "Communication Status", "options": "CRM Communication Status" + }, + { + "fetch_from": "organization.territory", + "fieldname": "territory", + "fieldtype": "Data", + "label": "Territory", + "read_only": 1 } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-12-28 11:40:16.934256", + "modified": "2024-01-04 18:58:55.295874", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Deal", diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.json b/crm/fcrm/doctype/crm_lead/crm_lead.json index be950405..70569d62 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.json +++ b/crm/fcrm/doctype/crm_lead/crm_lead.json @@ -12,6 +12,7 @@ "details", "organization", "website", + "territory", "industry", "job_title", "source", @@ -270,12 +271,19 @@ "fieldtype": "Link", "label": "Communication Status", "options": "CRM Communication Status" + }, + { + "fetch_from": "organization.territory", + "fieldname": "territory", + "fieldtype": "Data", + "label": "Territory", + "read_only": 1 } ], "image_field": "image", "index_web_pages_for_search": 1, "links": [], - "modified": "2023-12-28 11:39:47.573673", + "modified": "2024-01-04 18:58:26.603817", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Lead", diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.json b/crm/fcrm/doctype/crm_organization/crm_organization.json index b2eb2bd7..1b300b94 100644 --- a/crm/fcrm/doctype/crm_organization/crm_organization.json +++ b/crm/fcrm/doctype/crm_organization/crm_organization.json @@ -9,10 +9,11 @@ "field_order": [ "organization_name", "no_of_employees", + "annual_revenue", "organization_logo", "column_break_pnpp", "website", - "annual_revenue", + "territory", "industry" ], "fields": [ @@ -53,12 +54,18 @@ "fieldtype": "Link", "label": "Industry", "options": "CRM Industry" + }, + { + "fieldname": "territory", + "fieldtype": "Link", + "label": "Territory", + "options": "CRM Territory" } ], "image_field": "organization_logo", "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-23 13:11:37.301082", + "modified": "2024-01-04 18:57:52.519305", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Organization", diff --git a/crm/fcrm/doctype/crm_territory/__init__.py b/crm/fcrm/doctype/crm_territory/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crm/fcrm/doctype/crm_territory/crm_territory.js b/crm/fcrm/doctype/crm_territory/crm_territory.js new file mode 100644 index 00000000..568e9c4c --- /dev/null +++ b/crm/fcrm/doctype/crm_territory/crm_territory.js @@ -0,0 +1,8 @@ +// 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 new file mode 100644 index 00000000..60b6b43f --- /dev/null +++ b/crm/fcrm/doctype/crm_territory/crm_territory.json @@ -0,0 +1,113 @@ +{ + "actions": [], + "allow_rename": 1, + "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", + "is_group", + "column_break_pypy", + "lft", + "rgt" + ], + "fields": [ + { + "fieldname": "territory_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Territory Name", + "reqd": 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-04 18:56:49.292276", + "modified_by": "Administrator", + "module": "FCRM", + "name": "CRM Territory", + "nsm_parent_field": "parent_crm_territory", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System 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 new file mode 100644 index 00000000..d08f3bee --- /dev/null +++ b/crm/fcrm/doctype/crm_territory/crm_territory.py @@ -0,0 +1,9 @@ +# 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 new file mode 100644 index 00000000..475707fd --- /dev/null +++ b/crm/fcrm/doctype/crm_territory/test_crm_territory.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestCRMTerritory(FrappeTestCase): + pass