Skip to content

Commit

Permalink
Merge pull request #426 from frappe/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik authored Oct 24, 2024
2 parents e34bb2d + fd23d66 commit bbed5cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crm/fcrm/doctype/crm_deal/crm_deal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion crm/fcrm/doctype/crm_lead/crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Activities/Activities.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/Modals/ContactModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit bbed5cb

Please sign in to comment.