fix: Last Communication for lead
- Remove unused code - Remove unused import
This commit is contained in:
parent
7ff124db95
commit
2f84779667
@ -33,7 +33,6 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
||||
frappe.dynamic_link = { doc: doc, fieldname: 'name', doctype: 'Lead' }
|
||||
|
||||
if(!doc.__islocal && doc.__onload && !doc.__onload.is_customer) {
|
||||
this.frm.add_custom_button(__("Call"), this.call);
|
||||
this.frm.add_custom_button(__("Customer"), this.create_customer, __('Create'));
|
||||
this.frm.add_custom_button(__("Opportunity"), this.create_opportunity, __('Create'));
|
||||
this.frm.add_custom_button(__("Quotation"), this.make_quotation, __('Create'));
|
||||
@ -53,14 +52,6 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
||||
})
|
||||
},
|
||||
|
||||
call: () => {
|
||||
frappe.xcall('erpnext.erpnext_integrations.exotel_integration.make_a_call', {
|
||||
'to_number': this.frm.doc.phone,
|
||||
'from_number': '<nam>',
|
||||
'caller_id': '09513886363'
|
||||
}).then(console.log)
|
||||
},
|
||||
|
||||
create_opportunity: function () {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.crm.doctype.lead.lead.make_opportunity",
|
||||
|
@ -56,7 +56,7 @@ def get_last_interaction(number, reference_doc):
|
||||
}, ['name', 'subject', 'customer'], limit=1)
|
||||
|
||||
elif reference_doc.doctype == 'Lead':
|
||||
last_communication = frappe.get_all('Communication', {
|
||||
last_communication = frappe.get_all('Communication', filters={
|
||||
'reference_doctype': reference_doc.doctype,
|
||||
'reference_name': reference_doc.name,
|
||||
'sent_or_received': 'Received'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import frappe
|
||||
from erpnext.crm.doctype.utils import get_document_with_phone_number, get_employee_emails_for_popup
|
||||
from erpnext.crm.doctype.utils import get_employee_emails_for_popup
|
||||
import requests
|
||||
|
||||
# api/method/erpnext.erpnext_integrations.exotel_integration.handle_incoming_call
|
||||
|
@ -175,7 +175,6 @@ class CallPopup {
|
||||
if (data.last_communication) {
|
||||
const comm = data.last_communication;
|
||||
comm_field.set_value(comm.content);
|
||||
comm_field.$wrapper.append(frappe.utils.get_form_link('Communication', comm.name));
|
||||
}
|
||||
|
||||
if (data.last_issue) {
|
||||
@ -183,7 +182,7 @@ class CallPopup {
|
||||
const issue_field = this.dialog.fields_dict["last_issue"];
|
||||
issue_field.set_value(issue.subject);
|
||||
issue_field.$wrapper.append(`<a class="text-medium" href="#List/Issue?customer=${issue.customer}">
|
||||
View all issues from ${issue.customer}
|
||||
${__('View all issues from {0}', [issue.customer])}
|
||||
</a>`);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user