diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index 395619b73..dc18c1331 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -18,7 +18,7 @@ def before_validate(self): 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"): diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index 75ca04e06..632080a90 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -21,7 +21,7 @@ def validate(self): 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"): diff --git a/frontend/src/components/Activities/Activities.vue b/frontend/src/components/Activities/Activities.vue index f46139988..2a3f3dd67 100644 --- a/frontend/src/components/Activities/Activities.vue +++ b/frontend/src/components/Activities/Activities.vue @@ -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') { diff --git a/frontend/src/components/Modals/ContactModal.vue b/frontend/src/components/Modals/ContactModal.vue index 3872b1fe7..e7690682e 100644 --- a/frontend/src/components/Modals/ContactModal.vue +++ b/frontend/src/components/Modals/ContactModal.vue @@ -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) {