From 229f67664544dac15c81ad827e92ef46afa5740d Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Mon, 9 Oct 2017 13:09:41 +0530 Subject: [PATCH] [hotfix] minor fixes in the Email Communication subject field (#4278) --- frappe/public/js/frappe/views/communication.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 1625ff4849..42924f47b9 100755 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -149,7 +149,12 @@ frappe.views.CommunicationComposer = Class.extend({ if (this.frm.subject_field && this.frm.doc[this.frm.subject_field]) { this.subject = __("Re: {0}", [this.frm.doc[this.frm.subject_field]]); } else { - this.subject = __(this.frm.doctype) + ': ' + this.frm[this.frm.meta.title_field || name]; + let title = this.frm.doc.name; + if(this.frm.meta.title_field && this.frm.doc[this.frm.meta.title_field] + && this.frm.doc[this.frm.meta.title_field] != this.frm.doc.name) { + title = `${this.frm.doc[this.frm.meta.title_field]} (#${this.frm.doc.name})`; + } + this.subject = `${__(this.frm.doctype)}: ${title}`; } } }