separated communication view

This commit is contained in:
Rushabh Mehta
2012-11-26 18:18:10 +05:30
parent 36b586cdfe
commit c4e7b6800a
8 changed files with 128 additions and 144 deletions

View File

@@ -241,3 +241,18 @@ class TransactionBase:
def get_formatted_message(self, args):
""" get formatted message for auto notification"""
return get_obj('Notification Control').get_formatted_message(args)
def add_communication_list(self):
# remove communications if present
self.doclist = webnotes.doclist(self.doclist).get({
"doctype": ["!=", "Communcation"]})
comm_list = webnotes.conn.sql("""select * from tabCommunication
where %s=%s order by modified desc limit 20""" \
% (self.doc.doctype.replace(" ", "_").lower(), "%s"),
self.doc.name, as_dict=1)
[d.update({"doctype":"Communication"}) for d in comm_list]
self.doclist.extend(webnotes.doclist([webnotes.doc(fielddata=d) \
for d in comm_list]))