Merge pull request #426 from frappe/develop
This commit is contained in:
commit
bbed5cb170
@ -18,7 +18,7 @@ class CRMDeal(Document):
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
self.set_primary_contact()
|
self.set_primary_contact()
|
||||||
self.set_primary_email_mobile_no()
|
self.set_primary_email_mobile_no()
|
||||||
if self.deal_owner and not self.is_new():
|
if not self.is_new() and self.has_value_changed("deal_owner") and self.deal_owner:
|
||||||
self.share_with_agent(self.deal_owner)
|
self.share_with_agent(self.deal_owner)
|
||||||
self.assign_agent(self.deal_owner)
|
self.assign_agent(self.deal_owner)
|
||||||
if self.has_value_changed("status"):
|
if self.has_value_changed("status"):
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class CRMLead(Document):
|
|||||||
self.set_lead_name()
|
self.set_lead_name()
|
||||||
self.set_title()
|
self.set_title()
|
||||||
self.validate_email()
|
self.validate_email()
|
||||||
if self.lead_owner and not self.is_new():
|
if not self.is_new() and self.has_value_changed("lead_owner") and self.lead_owner:
|
||||||
self.share_with_agent(self.lead_owner)
|
self.share_with_agent(self.lead_owner)
|
||||||
self.assign_agent(self.lead_owner)
|
self.assign_agent(self.lead_owner)
|
||||||
if self.has_value_changed("status"):
|
if self.has_value_changed("status"):
|
||||||
|
|||||||
@ -652,12 +652,12 @@ const activities = computed(() => {
|
|||||||
_activities = get_activities()
|
_activities = get_activities()
|
||||||
} else if (title.value == 'Emails') {
|
} else if (title.value == 'Emails') {
|
||||||
if (!all_activities.data?.versions) return []
|
if (!all_activities.data?.versions) return []
|
||||||
activities = all_activities.data.versions.filter(
|
_activities = all_activities.data.versions.filter(
|
||||||
(activity) => activity.activity_type === 'communication',
|
(activity) => activity.activity_type === 'communication',
|
||||||
)
|
)
|
||||||
} else if (title.value == 'Comments') {
|
} else if (title.value == 'Comments') {
|
||||||
if (!all_activities.data?.versions) return []
|
if (!all_activities.data?.versions) return []
|
||||||
activities = all_activities.data.versions.filter(
|
_activities = all_activities.data.versions.filter(
|
||||||
(activity) => activity.activity_type === 'comment',
|
(activity) => activity.activity_type === 'comment',
|
||||||
)
|
)
|
||||||
} else if (title.value == 'Calls') {
|
} else if (title.value == 'Calls') {
|
||||||
|
|||||||
@ -279,7 +279,7 @@ const filteredSections = computed(() => {
|
|||||||
_contact.value.email_id = option.value
|
_contact.value.email_id = option.value
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
editOption('Contact Email', option.name, option.value)
|
editOption('Contact Email', option.name, 'email_id', option.value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onDelete: async (option, isNew) => {
|
onDelete: async (option, isNew) => {
|
||||||
@ -332,7 +332,7 @@ const filteredSections = computed(() => {
|
|||||||
_contact.value.actual_mobile_no = option.value
|
_contact.value.actual_mobile_no = option.value
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
editOption('Contact Phone', option.name, option.value)
|
editOption('Contact Phone', option.name, 'phone', option.value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onDelete: async (option, isNew) => {
|
onDelete: async (option, isNew) => {
|
||||||
@ -415,11 +415,11 @@ async function createNew(field, value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editOption(doctype, name, value) {
|
async function editOption(doctype, name, fieldname, value) {
|
||||||
let d = await call('frappe.client.set_value', {
|
let d = await call('frappe.client.set_value', {
|
||||||
doctype,
|
doctype,
|
||||||
name,
|
name,
|
||||||
fieldname: doctype == 'Contact Phone' ? 'phone' : 'email',
|
fieldname,
|
||||||
value,
|
value,
|
||||||
})
|
})
|
||||||
if (d) {
|
if (d) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user