diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 8b91b3db..9e9818d3 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -8,31 +8,40 @@ "engine": "InnoDB", "field_order": [ "organization_tab", + "naming_series", "organization", - "website", - "territory", - "annual_revenue", - "close_date", - "probability", "next_step", + "probability", + "column_break_ijan", + "status", + "close_date", "deal_owner", "contacts_tab", + "contacts", + "contact", + "lead_details_tab", + "lead", + "source", + "column_break_wsde", "lead_name", + "organization_details_section", + "organization_name", + "website", + "no_of_employees", + "job_title", + "column_break_xbyf", + "territory", + "annual_revenue", + "industry", + "person_section", + "salutation", + "first_name", + "last_name", + "column_break_xjmy", "email", "mobile_no", "phone", - "contacts", - "others_tab", - "naming_series", - "status", - "section_break_sygz", - "no_of_employees", - "column_break_nwob", - "job_title", - "section_break_eepu", - "lead", - "column_break_bqvs", - "source", + "gender", "sla_tab", "sla", "sla_creation", @@ -88,14 +97,6 @@ "label": "Lead", "options": "CRM Lead" }, - { - "fieldname": "section_break_eepu", - "fieldtype": "Section Break" - }, - { - "fieldname": "column_break_bqvs", - "fieldtype": "Column Break" - }, { "fieldname": "deal_owner", "fieldtype": "Link", @@ -142,12 +143,6 @@ "label": "Contacts", "options": "CRM Contacts" }, - { - "fieldname": "others_tab", - "fieldtype": "Tab Break", - "label": "Others", - "read_only": 1 - }, { "fieldname": "organization_tab", "fieldtype": "Tab Break", @@ -235,14 +230,6 @@ "label": "No. of Employees", "options": "1-10\n11-50\n51-200\n201-500\n501-1000\n1000+" }, - { - "fieldname": "section_break_sygz", - "fieldtype": "Section Break" - }, - { - "fieldname": "column_break_nwob", - "fieldtype": "Column Break" - }, { "fieldname": "job_title", "fieldtype": "Data", @@ -270,11 +257,81 @@ "fieldname": "lead_name", "fieldtype": "Data", "label": "Lead Name" + }, + { + "fieldname": "column_break_ijan", + "fieldtype": "Column Break" + }, + { + "fieldname": "lead_details_tab", + "fieldtype": "Tab Break", + "label": "Lead Details" + }, + { + "fieldname": "column_break_wsde", + "fieldtype": "Column Break" + }, + { + "fieldname": "organization_details_section", + "fieldtype": "Section Break", + "label": "Organization Details" + }, + { + "fieldname": "organization_name", + "fieldtype": "Data", + "label": "Organization Name" + }, + { + "fieldname": "column_break_xbyf", + "fieldtype": "Column Break" + }, + { + "fieldname": "industry", + "fieldtype": "Link", + "label": "Industry", + "options": "CRM Industry" + }, + { + "fieldname": "person_section", + "fieldtype": "Section Break", + "label": "Person" + }, + { + "fieldname": "salutation", + "fieldtype": "Link", + "label": "Salutation", + "options": "Salutation" + }, + { + "fieldname": "first_name", + "fieldtype": "Data", + "label": "First Name" + }, + { + "fieldname": "last_name", + "fieldtype": "Data", + "label": "Last Name" + }, + { + "fieldname": "column_break_xjmy", + "fieldtype": "Column Break" + }, + { + "fieldname": "gender", + "fieldtype": "Link", + "label": "Gender", + "options": "Gender" + }, + { + "fieldname": "contact", + "fieldtype": "Link", + "label": "Contact", + "options": "Contact" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-01-25 21:00:08.216020", + "modified": "2024-06-19 18:01:59.213811", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Deal", diff --git a/crm/install.py b/crm/install.py index 923cbd4e..92d8a2ef 100644 --- a/crm/install.py +++ b/crm/install.py @@ -113,19 +113,19 @@ def add_default_fields_layout(): layouts = { "CRM Lead-Quick Entry": { "doctype": "CRM Lead", - "layout": '[\n{\n"label": "Person",\n\t"fields": ["salutation", "first_name", "last_name", "email", "mobile_no", "gender"]\n},\n{\n"label": "Organization",\n\t"fields": ["organization", "website", "no_of_employees", "territory", "annual_revenue", "industry"]\n},\n{\n"label": "Other",\n"columns": 2,\n\t"fields": ["status", "lead_owner"]\n}\n]' + "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}]' }, "CRM Deal-Quick Entry": { "doctype": "CRM Deal", - "layout": '[\n{\n"label": "Select Organization",\n\t"fields": ["organization"]\n},\n{\n"label": "Organization Details",\n\t"fields": [{"label": "Organization Name", "name": "organization_name", "type": "Data"}, "website", "no_of_employees", "territory", "annual_revenue", {"label": "Industry", "name": "industry", "type": "Link", "options": "CRM Industry"}]\n},\n{\n"label": "Select Contact",\n\t"fields": [{"label": "Contact", "name": "contact", "type": "Link", "options": "Contact"}]\n},\n{\n"label": "Contact Details",\n\t"fields": [{"label": "Salutation", "name": "salutation", "type": "Link", "options": "Salutation"}, {"label": "First Name", "name": "first_name", "type": "Data"}, {"label": "Last Name", "name": "last_name", "type": "Data"}, "email", "mobile_no", {"label": "Gender", "name": "gender", "type": "Link", "options": "Gender"}]\n},\n{\n"label": "Other",\n"columns": 2,\n\t"fields": ["status", "deal_owner"]\n}\n]' + "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}]' }, "Contact-Quick Entry": { "doctype": "Contact", - "layout": '[\n{\n"label": "Salutation",\n"columns": 1,\n"fields": ["salutation"]\n},\n{\n"label": "Full Name",\n"columns": 2,\n"hideBorder": true,\n"fields": ["first_name", "last_name"]\n},\n{\n"label": "Email",\n"columns": 1,\n"hideBorder": true,\n"fields": ["email_id"]\n},\n{\n"label": "Mobile No. & Gender",\n"columns": 2,\n"hideBorder": true,\n"fields": ["mobile_no", "gender"]\n},\n{\n"label": "Organization",\n"columns": 1,\n"hideBorder": true,\n"fields": ["company_name"]\n},\n{\n"label": "Designation",\n"columns": 1,\n"hideBorder": true,\n"fields": ["designation"]\n}\n]' + "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}]' }, "Organization-Quick Entry": { "doctype": "CRM Organization", - "layout": '[\n{\n"label": "Organization Name",\n"columns": 1,\n"fields": ["organization_name"]\n},\n{\n"label": "Website & Revenue",\n"columns": 2,\n"hideBorder": true,\n"fields": ["website", "annual_revenue"]\n},\n{\n"label": "Territory",\n"columns": 1,\n"hideBorder": true,\n"fields": ["territory"]\n},\n{\n"label": "No of Employees & Industry",\n"columns": 2,\n"hideBorder": true,\n"fields": ["no_of_employees", "industry"]\n}\n]' + "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}]' }, } diff --git a/crm/patches.txt b/crm/patches.txt index 32c4485a..b4c07a8e 100644 --- a/crm/patches.txt +++ b/crm/patches.txt @@ -7,4 +7,5 @@ crm.patches.v1_0.move_crm_note_data_to_fcrm_note # Patches added in this section will be executed after doctypes are migrated crm.patches.v1_0.create_email_template_custom_fields crm.patches.v1_0.create_default_fields_layout -crm.patches.v1_0.create_default_sidebar_fields_layout \ No newline at end of file +crm.patches.v1_0.create_default_sidebar_fields_layout +crm.patches.v1_0.update_deal_quick_entry_layout \ 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 new file mode 100644 index 00000000..9cc54516 --- /dev/null +++ b/crm/patches/v1_0/update_deal_quick_entry_layout.py @@ -0,0 +1,15 @@ +import json +import frappe + +def execute(): + if not frappe.db.exists("CRM Fields Layout", "CRM Deal-Quick Entry"): + return + + deal = frappe.db.get_value("CRM Fields Layout", "CRM Deal-Quick Entry", "layout") + + layout = json.loads(deal) + for section in layout: + if section.get("label") in ["Select Organization", "Organization Details", "Select Contact", "Contact Details"]: + section["editable"] = True + + 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/Fields.vue b/frontend/src/components/Fields.vue index 6bfdc09f..238b3ada 100644 --- a/frontend/src/components/Fields.vue +++ b/frontend/src/components/Fields.vue @@ -6,6 +6,12 @@ class="first:border-t-0 first:pt-0" :class="section.hideBorder ? '' : 'border-t pt-4'" > +
+ {{ section.label }} +
+ + + + + diff --git a/frontend/src/components/SectionFields.vue b/frontend/src/components/SectionFields.vue index d80868b5..80a07229 100644 --- a/frontend/src/components/SectionFields.vue +++ b/frontend/src/components/SectionFields.vue @@ -36,7 +36,7 @@ { props.fields?.forEach((field) => { let df = field.all_properties if (df?.depends_on) evaluate_depends_on(df.depends_on, field) - all_fields.push(field) + all_fields.push({ + ...field, + placeholder: field.placeholder || field.label, + }) }) return all_fields }) diff --git a/frontend/src/components/Settings/QuickEntryLayout.vue b/frontend/src/components/Settings/QuickEntryLayout.vue new file mode 100644 index 00000000..a043dbe9 --- /dev/null +++ b/frontend/src/components/Settings/QuickEntryLayout.vue @@ -0,0 +1,113 @@ + + diff --git a/frontend/src/components/Settings/QuickEntryLayoutBuilder.vue b/frontend/src/components/Settings/QuickEntryLayoutBuilder.vue new file mode 100644 index 00000000..c285db8a --- /dev/null +++ b/frontend/src/components/Settings/QuickEntryLayoutBuilder.vue @@ -0,0 +1,220 @@ + + diff --git a/frontend/src/components/Settings/SettingsModal.vue b/frontend/src/components/Settings/SettingsModal.vue index ef90a91e..623621c7 100644 --- a/frontend/src/components/Settings/SettingsModal.vue +++ b/frontend/src/components/Settings/SettingsModal.vue @@ -40,10 +40,12 @@ import ContactsIcon from '@/components/Icons/ContactsIcon.vue' import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue' import PhoneIcon from '@/components/Icons/PhoneIcon.vue' +import RightSideLayoutIcon from '@/components/Icons/RightSideLayoutIcon.vue' import ProfileSettings from '@/components/Settings/ProfileSettings.vue' import WhatsAppSettings from '@/components/Settings/WhatsAppSettings.vue' import TwilioSettings from '@/components/Settings/TwilioSettings.vue' -import FieldsLayout from '@/components/Settings/FieldsLayout.vue' +import SidebarFieldsLayout from '@/components/Settings/SidebarFieldsLayout.vue' +import QuickEntryLayout from '@/components/Settings/QuickEntryLayout.vue' import SidebarLink from '@/components/SidebarLink.vue' import { isWhatsappInstalled } from '@/composables/settings' import { Dialog, FeatherIcon } from 'frappe-ui' @@ -84,9 +86,14 @@ const tabs = computed(() => { label: 'Customizations', items: [ { - label: 'Fields Layout', + label: 'Sidebar Fields Layout', + icon: RightSideLayoutIcon, + component: markRaw(SidebarFieldsLayout), + }, + { + label: 'Quick Entry Layout', icon: h(FeatherIcon, { name: 'grid' }), - component: markRaw(FieldsLayout), + component: markRaw(QuickEntryLayout), }, ], }, diff --git a/frontend/src/components/Settings/FieldsLayout.vue b/frontend/src/components/Settings/SidebarFieldsLayout.vue similarity index 77% rename from frontend/src/components/Settings/FieldsLayout.vue rename to frontend/src/components/Settings/SidebarFieldsLayout.vue index 0858cae0..86e8ace7 100644 --- a/frontend/src/components/Settings/FieldsLayout.vue +++ b/frontend/src/components/Settings/SidebarFieldsLayout.vue @@ -27,6 +27,10 @@ @click="saveChanges" />
- + +
+
+ +
+