fix: Last Communication for lead

- Remove unused code
- Remove unused import
This commit is contained in:
Suraj Shetty
2019-06-12 10:31:07 +05:30
parent 7ff124db95
commit 2f84779667
4 changed files with 3 additions and 13 deletions

View File

@@ -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",

View File

@@ -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'