fix: Add call summary
This commit is contained in:
parent
bd03a51e8f
commit
893a0c24bb
@ -65,4 +65,14 @@ def get_last_interaction(number, reference_doc):
|
|||||||
return {
|
return {
|
||||||
'last_communication': last_communication[0] if last_communication else None,
|
'last_communication': last_communication[0] if last_communication else None,
|
||||||
'last_issue': last_issue[0] if last_issue else None
|
'last_issue': last_issue[0] if last_issue else None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def add_call_summary(docname, summary):
|
||||||
|
communication = frappe.get_doc('Communication', docname)
|
||||||
|
communication.content = 'Call Summary by {user}: {summary}'.format({
|
||||||
|
'user': frappe.utils.get_fullname(frappe.session.user),
|
||||||
|
'summary': summary
|
||||||
|
})
|
||||||
|
communication.save(ignore_permissions=True)
|
||||||
|
|
||||||
|
@ -38,28 +38,14 @@ class CallPopup {
|
|||||||
'fieldtype': 'Small Text',
|
'fieldtype': 'Small Text',
|
||||||
'label': 'Call Summary',
|
'label': 'Call Summary',
|
||||||
'fieldname': 'call_summary',
|
'fieldname': 'call_summary',
|
||||||
}, {
|
|
||||||
'label': 'Append To',
|
|
||||||
'fieldtype': 'Select',
|
|
||||||
'fieldname': 'doctype',
|
|
||||||
'options': ['Issue', 'Lead', 'Communication'],
|
|
||||||
'default': this.call_log.doctype
|
|
||||||
}, {
|
|
||||||
'label': 'Document',
|
|
||||||
'fieldtype': 'Dynamic Link',
|
|
||||||
'fieldname': 'docname',
|
|
||||||
'options': 'doctype',
|
|
||||||
'default': this.call_log.name
|
|
||||||
}, {
|
}, {
|
||||||
'fieldtype': 'Button',
|
'fieldtype': 'Button',
|
||||||
'label': 'Submit',
|
'label': 'Submit',
|
||||||
'click': () => {
|
'click': () => {
|
||||||
const values = this.dialog.get_values();
|
const values = this.dialog.get_values();
|
||||||
frappe.xcall('frappe.desk.form.utils.add_comment', {
|
frappe.xcall('erpnext.crm.doctype.utils.add_call_summary', {
|
||||||
'reference_doctype': values.doctype,
|
'docname': this.call_log.name,
|
||||||
'reference_name': values.docname,
|
'summary': `${__('Call Summary')}: ${values.call_summary}`,
|
||||||
'content': `${__('Call Summary')}: ${values.call_summary}`,
|
|
||||||
'comment_email': frappe.session.user
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.dialog.set_value('call_summary', '');
|
this.dialog.set_value('call_summary', '');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user