Merge pull request #426 from frappe/develop

This commit is contained in:
Shariq Ansari 2024-10-24 20:14:12 +05:30 committed by GitHub
commit bbed5cb170
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@ class CRMDeal(Document):
def validate(self):
self.set_primary_contact()
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.assign_agent(self.deal_owner)
if self.has_value_changed("status"):

View File

@ -21,7 +21,7 @@ class CRMLead(Document):
self.set_lead_name()
self.set_title()
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.assign_agent(self.lead_owner)
if self.has_value_changed("status"):

View File

@ -652,12 +652,12 @@ const activities = computed(() => {
_activities = get_activities()
} else if (title.value == 'Emails') {
if (!all_activities.data?.versions) return []
activities = all_activities.data.versions.filter(
_activities = all_activities.data.versions.filter(
(activity) => activity.activity_type === 'communication',
)
} else if (title.value == 'Comments') {
if (!all_activities.data?.versions) return []
activities = all_activities.data.versions.filter(
_activities = all_activities.data.versions.filter(
(activity) => activity.activity_type === 'comment',
)
} else if (title.value == 'Calls') {

View File

@ -279,7 +279,7 @@ const filteredSections = computed(() => {
_contact.value.email_id = option.value
}
} else {
editOption('Contact Email', option.name, option.value)
editOption('Contact Email', option.name, 'email_id', option.value)
}
},
onDelete: async (option, isNew) => {
@ -332,7 +332,7 @@ const filteredSections = computed(() => {
_contact.value.actual_mobile_no = option.value
}
} else {
editOption('Contact Phone', option.name, option.value)
editOption('Contact Phone', option.name, 'phone', option.value)
}
},
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', {
doctype,
name,
fieldname: doctype == 'Contact Phone' ? 'phone' : 'email',
fieldname,
value,
})
if (d) {