diff --git a/crm/api/doc.py b/crm/api/doc.py index aeb76a6f..a5a7c51e 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 9df643d5..e8ba8b97 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 9a026098..1cc14d9a 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 c45ff55a..682a97fc 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 ce424763..d371ca52 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 1cbdb66d..ec196f8b 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 b4c07a8e..89401dda 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 1da7f510..e2d92d6e 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 2cfee64a..53890cce 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 b176cbdf..6b67bc32 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 295fe420..5eda760e 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 e4767ac8..c8f8075c 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 cb3d07ca..baa7ad2b 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 e6c939c3..c1f788cc 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 f62dc334..609988c5 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 b629c685..2775e3df 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 282517c9..f93d5e78 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 87884508..00b7808d 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 37bca0cb..c2b42fab 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 cce6ab5d..30701874 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 84a6cca8..ba73c6bf 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 3f1503c7..8098f835 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 4af76774..94a970c4 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 2c99bbc5..e64de76e 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 6ebcdfd0..f4e1a3c8 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 8118a8cf..fceacbae 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 825b47ab..8d82fa10 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 b72315d8..9ab6fc3f 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 01bbb813..1f5bc008 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 eb895fe9..2d944a3f 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 aed697b9..6425fd54 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 76fa5ff8..fab1edb2 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 5426940c..2bc4aad1 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 ce7f3a61..f7d6c6ce 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 4f231e9d..6176e45f 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 0d726d6b..05ea200b 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 11cb58ec..d5531305 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 49b29391..d8f3b02d 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 56cbbb40..2c508efd 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 59ebe23f..abfcc9c9 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 bc472325..bc15913a 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 c9866c49..9013d49d 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 274e5c24..5b45f9ad 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 8e6e55d9..a5f4aa7c 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 fe723d8b..bbf6d2e6 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 ca412f67..3872b1fe 100644 --- a/frontend/src/components/Modals/ContactModal.vue +++ b/frontend/src/components/Modals/ContactModal.vue @@ -78,10 +78,12 @@
+