Merge pull request #50 from shariquerik/territory
fix: create territory doctype and added in lead/deal/organization
This commit is contained in:
commit
7fcdd7aaed
@ -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",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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",
|
||||
|
||||
0
crm/fcrm/doctype/crm_territory/__init__.py
Normal file
0
crm/fcrm/doctype/crm_territory/__init__.py
Normal file
8
crm/fcrm/doctype/crm_territory/crm_territory.js
Normal file
8
crm/fcrm/doctype/crm_territory/crm_territory.js
Normal file
@ -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) {
|
||||
|
||||
// },
|
||||
// });
|
||||
116
crm/fcrm/doctype/crm_territory/crm_territory.json
Normal file
116
crm/fcrm/doctype/crm_territory/crm_territory.json
Normal file
@ -0,0 +1,116 @@
|
||||
{
|
||||
"actions": [],
|
||||
"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",
|
||||
"is_group",
|
||||
"column_break_pypy",
|
||||
"lft",
|
||||
"rgt"
|
||||
],
|
||||
"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-04 19:16:36.234887",
|
||||
"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": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
9
crm/fcrm/doctype/crm_territory/crm_territory.py
Normal file
9
crm/fcrm/doctype/crm_territory/crm_territory.py
Normal file
@ -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
|
||||
9
crm/fcrm/doctype/crm_territory/test_crm_territory.py
Normal file
9
crm/fcrm/doctype/crm_territory/test_crm_territory.py
Normal file
@ -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
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"charts": [],
|
||||
"content": "[{\"id\":\"1nr6UkvDiL\",\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h5\\\"><b>PORTAL</b></span>\",\"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\":\"<b>SHORTCUTS</b>\",\"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\":\"TZ7cULX3Tk\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"zpySv0nGVQ\",\"type\":\"paragraph\",\"data\":{\"text\":\"<b>META</b>\",\"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\":\"ApHOcISpiJ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Communication Statuses\",\"col\":3}}]",
|
||||
"content": "[{\"id\":\"1nr6UkvDiL\",\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h5\\\"><b>PORTAL</b></span>\",\"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\":\"<b>SHORTCUTS</b>\",\"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\":\"<b>META</b>\",\"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,
|
||||
@ -13,7 +13,7 @@
|
||||
"is_hidden": 0,
|
||||
"label": "Frappe CRM",
|
||||
"links": [],
|
||||
"modified": "2023-12-13 19:59:33.129412",
|
||||
"modified": "2024-01-04 19:08:27.799960",
|
||||
"modified_by": "Administrator",
|
||||
"module": "FCRM",
|
||||
"name": "Frappe CRM",
|
||||
@ -64,6 +64,22 @@
|
||||
"stats_filter": "[]",
|
||||
"type": "DocType"
|
||||
},
|
||||
{
|
||||
"color": "Grey",
|
||||
"doc_view": "Tree",
|
||||
"label": "Territories",
|
||||
"link_to": "CRM Territory",
|
||||
"stats_filter": "[]",
|
||||
"type": "DocType"
|
||||
},
|
||||
{
|
||||
"color": "Grey",
|
||||
"doc_view": "List",
|
||||
"label": "Assignment Rule",
|
||||
"link_to": "Assignment Rule",
|
||||
"stats_filter": "[]",
|
||||
"type": "DocType"
|
||||
},
|
||||
{
|
||||
"color": "Grey",
|
||||
"doc_view": "List",
|
||||
|
||||
21
frontend/src/components/Icons/TerritoryIcon.vue
Normal file
21
frontend/src/components/Icons/TerritoryIcon.vue
Normal file
@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="lucide lucide-land-plot"
|
||||
>
|
||||
<path d="m12 8 6-3-6-3v10" />
|
||||
<path
|
||||
d="m8 11.99-5.5 3.14a1 1 0 0 0 0 1.74l8.5 4.86a2 2 0 0 0 2 0l8.5-4.86a1 1 0 0 0 0-1.74L16 12"
|
||||
/>
|
||||
<path d="m6.49 12.85 11.02 6.3" />
|
||||
<path d="M17.51 12.85 6.5 19.15" />
|
||||
</svg>
|
||||
</template>
|
||||
@ -66,6 +66,15 @@
|
||||
placeholder="Add Annual Revenue"
|
||||
/>
|
||||
</div>
|
||||
<Link
|
||||
class="flex-1"
|
||||
size="md"
|
||||
label="Territory"
|
||||
variant="outline"
|
||||
v-model="_organization.territory"
|
||||
doctype="CRM Territory"
|
||||
placeholder="Add Territory"
|
||||
/>
|
||||
<div class="flex gap-4">
|
||||
<FormControl
|
||||
class="flex-1"
|
||||
@ -119,6 +128,7 @@
|
||||
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||
import WebsiteIcon from '@/components/Icons/WebsiteIcon.vue'
|
||||
import OrganizationsIcon from '@/components/Icons/OrganizationsIcon.vue'
|
||||
import TerritoryIcon from '@/components/Icons/TerritoryIcon.vue'
|
||||
import Link from '@/components/Controls/Link.vue'
|
||||
import { organizationsStore } from '@/stores/organizations'
|
||||
import { FormControl, Dialog, call, FeatherIcon } from 'frappe-ui'
|
||||
@ -252,6 +262,11 @@ const fields = computed(() => {
|
||||
name: 'website',
|
||||
value: _organization.value.website,
|
||||
},
|
||||
{
|
||||
icon: TerritoryIcon,
|
||||
name: 'territory',
|
||||
value: _organization.value.territory,
|
||||
},
|
||||
{
|
||||
icon: h(FeatherIcon, { name: 'dollar-sign', class: 'h-4 w-4' }),
|
||||
name: 'annual_revenue',
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
<span class="">{{ contact.email_id }}</span>
|
||||
</div>
|
||||
<span
|
||||
v-if="contact.mobile_no && contact.email_id"
|
||||
v-if="contact.email_id"
|
||||
class="text-3xl leading-[0] text-gray-600"
|
||||
>
|
||||
·
|
||||
@ -80,10 +80,7 @@
|
||||
<span class="">{{ contact.mobile_no }}</span>
|
||||
</Tooltip>
|
||||
<span
|
||||
v-if="
|
||||
(contact.email_id || contact.mobile_no) &&
|
||||
contact.company_name
|
||||
"
|
||||
v-if="contact.mobile_no"
|
||||
class="text-3xl leading-[0] text-gray-600"
|
||||
>
|
||||
·
|
||||
@ -102,9 +99,7 @@
|
||||
<span class="">{{ contact.company_name }}</span>
|
||||
</div>
|
||||
<span
|
||||
v-if="
|
||||
contact.email_id || contact.mobile_no || contact.company_name
|
||||
"
|
||||
v-if="contact.company_name"
|
||||
class="text-3xl leading-[0] text-gray-600"
|
||||
>
|
||||
·
|
||||
|
||||
@ -66,7 +66,7 @@
|
||||
<span class="">{{ website(organization.website) }}</span>
|
||||
</div>
|
||||
<span
|
||||
v-if="organization.industry && organization.website"
|
||||
v-if="organization.website"
|
||||
class="text-3xl leading-[0] text-gray-600"
|
||||
>
|
||||
·
|
||||
@ -79,10 +79,20 @@
|
||||
<span class="">{{ organization.industry }}</span>
|
||||
</div>
|
||||
<span
|
||||
v-if="
|
||||
(organization.website || organization.industry) &&
|
||||
organization.annual_revenue
|
||||
"
|
||||
v-if="organization.industry"
|
||||
class="text-3xl leading-[0] text-gray-600"
|
||||
>
|
||||
·
|
||||
</span>
|
||||
<div
|
||||
v-if="organization.territory"
|
||||
class="flex items-center gap-1.5"
|
||||
>
|
||||
<TerritoryIcon class="h-4 w-4" />
|
||||
<span class="">{{ organization.territory }}</span>
|
||||
</div>
|
||||
<span
|
||||
v-if="organization.territory"
|
||||
class="text-3xl leading-[0] text-gray-600"
|
||||
>
|
||||
·
|
||||
@ -95,11 +105,7 @@
|
||||
<span class="">{{ organization.annual_revenue }}</span>
|
||||
</div>
|
||||
<span
|
||||
v-if="
|
||||
organization.website ||
|
||||
organization.industry ||
|
||||
organization.annual_revenue
|
||||
"
|
||||
v-if="organization.annual_revenue"
|
||||
class="text-3xl leading-[0] text-gray-600"
|
||||
>
|
||||
·
|
||||
@ -108,6 +114,7 @@
|
||||
v-if="
|
||||
organization.website ||
|
||||
organization.industry ||
|
||||
organization.territory ||
|
||||
organization.annual_revenue
|
||||
"
|
||||
variant="ghost"
|
||||
@ -243,6 +250,7 @@ import LeadsListView from '@/components/ListViews/LeadsListView.vue'
|
||||
import DealsListView from '@/components/ListViews/DealsListView.vue'
|
||||
import ContactsListView from '@/components/ListViews/ContactsListView.vue'
|
||||
import WebsiteIcon from '@/components/Icons/WebsiteIcon.vue'
|
||||
import TerritoryIcon from '@/components/Icons/TerritoryIcon.vue'
|
||||
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||
import CameraIcon from '@/components/Icons/CameraIcon.vue'
|
||||
import LeadsIcon from '@/components/Icons/LeadsIcon.vue'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user