diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index ea870509fa..1ce40fbcf2 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -27,7 +27,7 @@ class Communication(Document): return self.parent_doc def validate(self): - if not self.status: + if self.get("__islocal"): if self.reference_doctype and self.reference_name: self.status = "Linked" diff --git a/frappe/public/js/frappe/form/footer/timeline.js b/frappe/public/js/frappe/form/footer/timeline.js index 751e514325..6e3be6f969 100644 --- a/frappe/public/js/frappe/form/footer/timeline.js +++ b/frappe/public/js/frappe/form/footer/timeline.js @@ -227,14 +227,22 @@ frappe.ui.form.Comments = Class.extend({ btn: btn, callback: function(r) { if(!r.exc) { - var comment_exists = !!$.map(me.get_comments(), function(x) { - return x.name == r.message.name? true : undefined}).length; me.input.val(""); + + var comment = r.message; + var comments = me.get_comments(); + var comment_exists = false; + for (var i=0, l=comments.length; i