diff --git a/crm/api/doc.py b/crm/api/doc.py index aeb76a6fe..a5a7c51e4 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -682,6 +682,9 @@ def get_fields(doctype: str, allow_all_fieldtypes: bool = False): "mandatory": field.reqd, "read_only": field.read_only, "hidden": field.hidden, + "depends_on": field.depends_on, + "mandatory_depends_on": field.mandatory_depends_on, + "read_only_depends_on": field.read_only_depends_on, }) return _fields diff --git a/crm/fcrm/doctype/crm_form_script/crm_form_script.js b/crm/fcrm/doctype/crm_form_script/crm_form_script.js index 9df643d54..e8ba8b974 100644 --- a/crm/fcrm/doctype/crm_form_script/crm_form_script.js +++ b/crm/fcrm/doctype/crm_form_script/crm_form_script.js @@ -8,7 +8,29 @@ frappe.ui.form.on("CRM Form Script", { istable: 0, }, }); + + if (frm.doc.is_standard && !frappe.boot.developer_mode) { + frm.disable_form(); + frappe.show_alert( + __( + "Standard Form Scripts can not be modified, duplicate the Form Script instead." + ) + ); + } + + frm.trigger("add_enable_button"); }, + + add_enable_button(frm) { + frm.add_custom_button( + frm.doc.enabled ? __("Disable") : __("Enable"), + () => { + frm.set_value("enabled", !frm.doc.enabled); + frm.save(); + } + ); + }, + view(frm) { let has_form_boilerplate = frm.doc.script.includes( "function setupForm(" diff --git a/crm/fcrm/doctype/crm_form_script/crm_form_script.json b/crm/fcrm/doctype/crm_form_script/crm_form_script.json index 9a026098e..1cc14d9a3 100644 --- a/crm/fcrm/doctype/crm_form_script/crm_form_script.json +++ b/crm/fcrm/doctype/crm_form_script/crm_form_script.json @@ -10,6 +10,7 @@ "view", "column_break_gboh", "enabled", + "is_standard", "section_break_xeox", "script" ], @@ -52,11 +53,18 @@ "label": "Apply To", "options": "Form\nList", "set_only_once": 1 + }, + { + "default": "0", + "fieldname": "is_standard", + "fieldtype": "Check", + "label": "Is Standard", + "no_copy": 1 } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-04-10 18:27:17.617602", + "modified": "2024-09-11 12:56:09.288849", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Form Script", diff --git a/crm/fcrm/doctype/crm_form_script/crm_form_script.py b/crm/fcrm/doctype/crm_form_script/crm_form_script.py index c45ff55a6..682a97fc2 100644 --- a/crm/fcrm/doctype/crm_form_script/crm_form_script.py +++ b/crm/fcrm/doctype/crm_form_script/crm_form_script.py @@ -2,11 +2,26 @@ # For license information, please see license.txt import frappe +from frappe import _ from frappe.model.document import Document class CRMFormScript(Document): - pass + def validate(self): + in_user_env = not ( + frappe.flags.in_install + or frappe.flags.in_patch + or frappe.flags.in_test + or frappe.flags.in_fixtures + ) + if in_user_env and self.is_standard and not frappe.conf.developer_mode: + # only enabled can be changed for standard form scripts + if self.has_value_changed("enabled"): + enabled_value = self.enabled + self.reload() + self.enabled = enabled_value + else: + frappe.throw(_("You need to be in developer mode to edit a Standard Form Script")) def get_form_script(dt, view="Form"): """Returns the form script for the given doctype""" diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.json b/crm/fcrm/doctype/crm_organization/crm_organization.json index ce4247635..d371ca529 100644 --- a/crm/fcrm/doctype/crm_organization/crm_organization.json +++ b/crm/fcrm/doctype/crm_organization/crm_organization.json @@ -15,7 +15,8 @@ "column_break_pnpp", "website", "territory", - "industry" + "industry", + "address" ], "fields": [ { @@ -68,12 +69,18 @@ "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-06-20 12:59:55.297752", + "modified": "2024-09-13 15:52:05.106389", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Organization", diff --git a/crm/install.py b/crm/install.py index 1cbdb66d0..ec196f8b2 100644 --- a/crm/install.py +++ b/crm/install.py @@ -123,11 +123,15 @@ def add_default_fields_layout(): }, "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}]' + "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}]' }, "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}]' + "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}]' + }, + "Address-Quick Entry": { + "doctype": "Address", + "layout": '[{"label":"Address","columns":1,"fields":["address_title","address_type","address_line1","address_line2","city","state","country","pincode"],"hideLabel":true}]' }, } diff --git a/crm/patches.txt b/crm/patches.txt index b4c07a8e1..89401ddae 100644 --- a/crm/patches.txt +++ b/crm/patches.txt @@ -6,6 +6,6 @@ crm.patches.v1_0.move_crm_note_data_to_fcrm_note [post_model_sync] # 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_fields_layout #13/09/2024 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/public/manifest/apple-icon-180.png b/crm/public/manifest/apple-icon-180.png index 1da7f5103..e2d92d6ed 100644 Binary files a/crm/public/manifest/apple-icon-180.png and b/crm/public/manifest/apple-icon-180.png differ diff --git a/crm/public/manifest/apple-splash-1125-2436.jpg b/crm/public/manifest/apple-splash-1125-2436.jpg index 2cfee64a9..53890cce6 100644 Binary files a/crm/public/manifest/apple-splash-1125-2436.jpg and b/crm/public/manifest/apple-splash-1125-2436.jpg differ diff --git a/crm/public/manifest/apple-splash-1136-640.jpg b/crm/public/manifest/apple-splash-1136-640.jpg index b176cbdfb..6b67bc321 100644 Binary files a/crm/public/manifest/apple-splash-1136-640.jpg and b/crm/public/manifest/apple-splash-1136-640.jpg differ diff --git a/crm/public/manifest/apple-splash-1170-2532.jpg b/crm/public/manifest/apple-splash-1170-2532.jpg index 295fe4200..5eda760eb 100644 Binary files a/crm/public/manifest/apple-splash-1170-2532.jpg and b/crm/public/manifest/apple-splash-1170-2532.jpg differ diff --git a/crm/public/manifest/apple-splash-1179-2556.jpg b/crm/public/manifest/apple-splash-1179-2556.jpg index e4767ac84..c8f8075c7 100644 Binary files a/crm/public/manifest/apple-splash-1179-2556.jpg and b/crm/public/manifest/apple-splash-1179-2556.jpg differ diff --git a/crm/public/manifest/apple-splash-1242-2208.jpg b/crm/public/manifest/apple-splash-1242-2208.jpg index cb3d07ca2..baa7ad2b4 100644 Binary files a/crm/public/manifest/apple-splash-1242-2208.jpg and b/crm/public/manifest/apple-splash-1242-2208.jpg differ diff --git a/crm/public/manifest/apple-splash-1242-2688.jpg b/crm/public/manifest/apple-splash-1242-2688.jpg index e6c939c3f..c1f788cc0 100644 Binary files a/crm/public/manifest/apple-splash-1242-2688.jpg and b/crm/public/manifest/apple-splash-1242-2688.jpg differ diff --git a/crm/public/manifest/apple-splash-1284-2778.jpg b/crm/public/manifest/apple-splash-1284-2778.jpg index f62dc3344..609988c58 100644 Binary files a/crm/public/manifest/apple-splash-1284-2778.jpg and b/crm/public/manifest/apple-splash-1284-2778.jpg differ diff --git a/crm/public/manifest/apple-splash-1290-2796.jpg b/crm/public/manifest/apple-splash-1290-2796.jpg index b629c6854..2775e3dfd 100644 Binary files a/crm/public/manifest/apple-splash-1290-2796.jpg and b/crm/public/manifest/apple-splash-1290-2796.jpg differ diff --git a/crm/public/manifest/apple-splash-1334-750.jpg b/crm/public/manifest/apple-splash-1334-750.jpg index 282517c97..f93d5e78d 100644 Binary files a/crm/public/manifest/apple-splash-1334-750.jpg and b/crm/public/manifest/apple-splash-1334-750.jpg differ diff --git a/crm/public/manifest/apple-splash-1488-2266.jpg b/crm/public/manifest/apple-splash-1488-2266.jpg index 878845081..00b7808dc 100644 Binary files a/crm/public/manifest/apple-splash-1488-2266.jpg and b/crm/public/manifest/apple-splash-1488-2266.jpg differ diff --git a/crm/public/manifest/apple-splash-1536-2048.jpg b/crm/public/manifest/apple-splash-1536-2048.jpg index 37bca0cba..c2b42fab5 100644 Binary files a/crm/public/manifest/apple-splash-1536-2048.jpg and b/crm/public/manifest/apple-splash-1536-2048.jpg differ diff --git a/crm/public/manifest/apple-splash-1620-2160.jpg b/crm/public/manifest/apple-splash-1620-2160.jpg index cce6ab5de..30701874d 100644 Binary files a/crm/public/manifest/apple-splash-1620-2160.jpg and b/crm/public/manifest/apple-splash-1620-2160.jpg differ diff --git a/crm/public/manifest/apple-splash-1640-2360.jpg b/crm/public/manifest/apple-splash-1640-2360.jpg index 84a6cca8b..ba73c6bf8 100644 Binary files a/crm/public/manifest/apple-splash-1640-2360.jpg and b/crm/public/manifest/apple-splash-1640-2360.jpg differ diff --git a/crm/public/manifest/apple-splash-1668-2224.jpg b/crm/public/manifest/apple-splash-1668-2224.jpg index 3f1503c7c..8098f8357 100644 Binary files a/crm/public/manifest/apple-splash-1668-2224.jpg and b/crm/public/manifest/apple-splash-1668-2224.jpg differ diff --git a/crm/public/manifest/apple-splash-1668-2388.jpg b/crm/public/manifest/apple-splash-1668-2388.jpg index 4af76774e..94a970c4e 100644 Binary files a/crm/public/manifest/apple-splash-1668-2388.jpg and b/crm/public/manifest/apple-splash-1668-2388.jpg differ diff --git a/crm/public/manifest/apple-splash-1792-828.jpg b/crm/public/manifest/apple-splash-1792-828.jpg index 2c99bbc53..e64de76ed 100644 Binary files a/crm/public/manifest/apple-splash-1792-828.jpg and b/crm/public/manifest/apple-splash-1792-828.jpg differ diff --git a/crm/public/manifest/apple-splash-2048-1536.jpg b/crm/public/manifest/apple-splash-2048-1536.jpg index 6ebcdfd0b..f4e1a3c8f 100644 Binary files a/crm/public/manifest/apple-splash-2048-1536.jpg and b/crm/public/manifest/apple-splash-2048-1536.jpg differ diff --git a/crm/public/manifest/apple-splash-2048-2732.jpg b/crm/public/manifest/apple-splash-2048-2732.jpg index 8118a8cfe..fceacbaee 100644 Binary files a/crm/public/manifest/apple-splash-2048-2732.jpg and b/crm/public/manifest/apple-splash-2048-2732.jpg differ diff --git a/crm/public/manifest/apple-splash-2160-1620.jpg b/crm/public/manifest/apple-splash-2160-1620.jpg index 825b47ab7..8d82fa101 100644 Binary files a/crm/public/manifest/apple-splash-2160-1620.jpg and b/crm/public/manifest/apple-splash-2160-1620.jpg differ diff --git a/crm/public/manifest/apple-splash-2208-1242.jpg b/crm/public/manifest/apple-splash-2208-1242.jpg index b72315d8b..9ab6fc3ff 100644 Binary files a/crm/public/manifest/apple-splash-2208-1242.jpg and b/crm/public/manifest/apple-splash-2208-1242.jpg differ diff --git a/crm/public/manifest/apple-splash-2224-1668.jpg b/crm/public/manifest/apple-splash-2224-1668.jpg index 01bbb8137..1f5bc0080 100644 Binary files a/crm/public/manifest/apple-splash-2224-1668.jpg and b/crm/public/manifest/apple-splash-2224-1668.jpg differ diff --git a/crm/public/manifest/apple-splash-2266-1488.jpg b/crm/public/manifest/apple-splash-2266-1488.jpg index eb895fe9a..2d944a3f8 100644 Binary files a/crm/public/manifest/apple-splash-2266-1488.jpg and b/crm/public/manifest/apple-splash-2266-1488.jpg differ diff --git a/crm/public/manifest/apple-splash-2360-1640.jpg b/crm/public/manifest/apple-splash-2360-1640.jpg index aed697b9d..6425fd548 100644 Binary files a/crm/public/manifest/apple-splash-2360-1640.jpg and b/crm/public/manifest/apple-splash-2360-1640.jpg differ diff --git a/crm/public/manifest/apple-splash-2388-1668.jpg b/crm/public/manifest/apple-splash-2388-1668.jpg index 76fa5ff80..fab1edb25 100644 Binary files a/crm/public/manifest/apple-splash-2388-1668.jpg and b/crm/public/manifest/apple-splash-2388-1668.jpg differ diff --git a/crm/public/manifest/apple-splash-2436-1125.jpg b/crm/public/manifest/apple-splash-2436-1125.jpg index 5426940cf..2bc4aad18 100644 Binary files a/crm/public/manifest/apple-splash-2436-1125.jpg and b/crm/public/manifest/apple-splash-2436-1125.jpg differ diff --git a/crm/public/manifest/apple-splash-2532-1170.jpg b/crm/public/manifest/apple-splash-2532-1170.jpg index ce7f3a61f..f7d6c6cec 100644 Binary files a/crm/public/manifest/apple-splash-2532-1170.jpg and b/crm/public/manifest/apple-splash-2532-1170.jpg differ diff --git a/crm/public/manifest/apple-splash-2556-1179.jpg b/crm/public/manifest/apple-splash-2556-1179.jpg index 4f231e9d3..6176e45fd 100644 Binary files a/crm/public/manifest/apple-splash-2556-1179.jpg and b/crm/public/manifest/apple-splash-2556-1179.jpg differ diff --git a/crm/public/manifest/apple-splash-2688-1242.jpg b/crm/public/manifest/apple-splash-2688-1242.jpg index 0d726d6bf..05ea200b6 100644 Binary files a/crm/public/manifest/apple-splash-2688-1242.jpg and b/crm/public/manifest/apple-splash-2688-1242.jpg differ diff --git a/crm/public/manifest/apple-splash-2732-2048.jpg b/crm/public/manifest/apple-splash-2732-2048.jpg index 11cb58ecb..d55313052 100644 Binary files a/crm/public/manifest/apple-splash-2732-2048.jpg and b/crm/public/manifest/apple-splash-2732-2048.jpg differ diff --git a/crm/public/manifest/apple-splash-2778-1284.jpg b/crm/public/manifest/apple-splash-2778-1284.jpg index 49b293912..d8f3b02d5 100644 Binary files a/crm/public/manifest/apple-splash-2778-1284.jpg and b/crm/public/manifest/apple-splash-2778-1284.jpg differ diff --git a/crm/public/manifest/apple-splash-2796-1290.jpg b/crm/public/manifest/apple-splash-2796-1290.jpg index 56cbbb407..2c508efd3 100644 Binary files a/crm/public/manifest/apple-splash-2796-1290.jpg and b/crm/public/manifest/apple-splash-2796-1290.jpg differ diff --git a/crm/public/manifest/apple-splash-640-1136.jpg b/crm/public/manifest/apple-splash-640-1136.jpg index 59ebe23fc..abfcc9c90 100644 Binary files a/crm/public/manifest/apple-splash-640-1136.jpg and b/crm/public/manifest/apple-splash-640-1136.jpg differ diff --git a/crm/public/manifest/apple-splash-750-1334.jpg b/crm/public/manifest/apple-splash-750-1334.jpg index bc4723251..bc15913ac 100644 Binary files a/crm/public/manifest/apple-splash-750-1334.jpg and b/crm/public/manifest/apple-splash-750-1334.jpg differ diff --git a/crm/public/manifest/apple-splash-828-1792.jpg b/crm/public/manifest/apple-splash-828-1792.jpg index c9866c49b..9013d49db 100644 Binary files a/crm/public/manifest/apple-splash-828-1792.jpg and b/crm/public/manifest/apple-splash-828-1792.jpg differ diff --git a/crm/public/manifest/manifest-icon-192.maskable.png b/crm/public/manifest/manifest-icon-192.maskable.png index 274e5c247..5b45f9ad9 100644 Binary files a/crm/public/manifest/manifest-icon-192.maskable.png and b/crm/public/manifest/manifest-icon-192.maskable.png differ diff --git a/crm/public/manifest/manifest-icon-512.maskable.png b/crm/public/manifest/manifest-icon-512.maskable.png index 8e6e55d98..a5f4aa7ce 100644 Binary files a/crm/public/manifest/manifest-icon-512.maskable.png and b/crm/public/manifest/manifest-icon-512.maskable.png differ diff --git a/frontend/src/components/Fields.vue b/frontend/src/components/Fields.vue index fe723d8b9..bbf6d2e66 100644 --- a/frontend/src/components/Fields.vue +++ b/frontend/src/components/Fields.vue @@ -23,9 +23,11 @@
*
- +
+ + +
+ diff --git a/frontend/src/components/Modals/ContactModal.vue b/frontend/src/components/Modals/ContactModal.vue index ca412f67b..3872b1fe7 100644 --- a/frontend/src/components/Modals/ContactModal.vue +++ b/frontend/src/components/Modals/ContactModal.vue @@ -78,10 +78,12 @@
+