fix: added phone, no_of_employees & job_title field in deal

This commit is contained in:
Shariq Ansari 2024-01-05 16:13:22 +05:30
parent 76725370a9
commit 91ed8c639b
3 changed files with 35 additions and 1 deletions

View File

@ -19,10 +19,15 @@
"contacts_tab",
"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",
@ -221,11 +226,36 @@
"fieldtype": "Link",
"label": "Source",
"options": "CRM Lead Source"
},
{
"fieldname": "no_of_employees",
"fieldtype": "Select",
"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",
"label": "Job Title"
},
{
"fieldname": "phone",
"fieldtype": "Data",
"label": "Phone",
"options": "Phone"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-01-04 20:53:31.618792",
"modified": "2024-01-05 16:10:59.595577",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Deal",

View File

@ -45,6 +45,7 @@ class CRMDeal(Document):
if not self.contacts:
self.email = ""
self.mobile_no = ""
self.phone = ""
return
if len([contact for contact in self.contacts if contact.is_primary]) > 1:
@ -56,11 +57,13 @@ class CRMDeal(Document):
primary_contact_exists = True
self.email = d.email.strip()
self.mobile_no = d.mobile_no.strip()
self.phone = d.phone.strip()
break
if not primary_contact_exists:
self.email = ""
self.mobile_no = ""
self.phone = ""
def update_organization(self):
if self.organization:

View File

@ -125,6 +125,7 @@ export function setupAssignees(data) {
}
export function setupCustomActions(data, obj) {
if (!data._form_script) return []
let script = new Function(data._form_script + '\nreturn setupForm')()
let formScript = script(obj)
data._customActions = formScript?.actions || []