Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait
2012-12-28 16:46:48 +05:30
10 changed files with 78 additions and 55 deletions

View File

@@ -89,7 +89,7 @@ class SupportMailbox(POP3Mailbox):
st.doc.status = 'Open'
st.doc.save()
update_feed(st.doc, 'on_update')
update_feed(st, 'on_update')
# extract attachments
self.save_attachments(st.doc, mail.attachments)
return
@@ -109,21 +109,20 @@ class SupportMailbox(POP3Mailbox):
d.naming_series = opts and opts.split("\n")[0] or 'SUP'
try:
d.save(1)
try:
# extract attachments
self.save_attachments(d, mail.attachments)
except Exception, e:
self.description += "\n\n[Did not pull attachment]"
except:
d.description = 'Unable to extract message'
d.save(1)
else:
# update feed
update_feed(d, 'on_update')
# send auto reply
if cint(self.email_settings.send_autoreply):
if "mailer-daemon" not in d.raised_by.lower():
self.send_auto_reply(d)
# extract attachments
self.save_attachments(d, mail.attachments)
def save_attachments(self, doc, attachment_list=[]):
"""

View File

@@ -50,11 +50,11 @@ class DocType(TransactionBase):
def close_ticket(self):
webnotes.conn.set(self.doc,'status','Closed')
update_feed(self.doc)
update_feed(self)
def reopen_ticket(self):
webnotes.conn.set(self.doc,'status','Open')
update_feed(self.doc)
update_feed(self)
def on_trash(self):
webnotes.conn.sql("""update `tabCommunication` set support_ticket=NULL