support_ticket: load communication onload

This commit is contained in:
Rushabh Mehta 2012-11-24 17:07:19 +05:30
parent a3207977d9
commit 87ce772749
2 changed files with 4 additions and 2 deletions

View File

@ -149,13 +149,15 @@ erpnext.CommunicationView = Class.extend({
var me = this;
this.body = $(repl('<div class="communication" title="Click to Expand / Collapse">\
<p><b>%(email_address)s on %(when)s</b></p>\
<p class="comm-content" style="border-top: 1px solid #ddd">%(content)s</p>\
<div class="comm-content" style="border-top: 1px solid #ddd; padding: 10px"></div>\
</div>', this.doc))
.appendTo(this.parent)
.css({"cursor":"pointer"})
.click(function() {
$(this).find(".comm-content").toggle();
});
this.body.find(".comm-content").html(this.doc.content);
},
toggle: function() {
this.body.find(".comm-content").toggle();

View File

@ -34,7 +34,7 @@ class DocType(TransactionBase):
def add_communication_list(self):
# remove communications if present
self.doclist = self.doclist.get({"doctype": ["!=", "Communcation"]})
self.doclist = webnotes.doclist(self.doclist).get({"doctype": ["!=", "Communcation"]})
comm_list = webnotes.conn.sql("""select * from tabCommunication
where support_ticket=%s order by modified desc limit 20""", self.doc.name, as_dict=1)