From 2bc141f5db4f181b1efb095e910a5749fb726e90 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 6 Mar 2012 18:05:23 +0530 Subject: [PATCH] fix in support ticket and email settings --- .../doctype/email_settings/email_settings.py | 18 +++--------------- .../support/doctype/support_ticket/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/erpnext/setup/doctype/email_settings/email_settings.py b/erpnext/setup/doctype/email_settings/email_settings.py index 0f930bcef1..c670b317c9 100644 --- a/erpnext/setup/doctype/email_settings/email_settings.py +++ b/erpnext/setup/doctype/email_settings/email_settings.py @@ -35,8 +35,8 @@ class DocType: """ Update value in control panel """ - if self.doc.fields.get(key): - webnotes.conn.set_value('Control Panel', None, key, self.doc.fields[key]) + webnotes.conn.set_value('Control Panel', None, key, + self.doc.fields.get(key)) def validate(self): """ @@ -117,19 +117,7 @@ class DocType: def on_update(self): """ - Sets or cancels the event in the scheduler + update control panel """ - # update control panel for f in ('outgoing_mail_server', 'mail_login', 'mail_password', 'auto_email_id', 'mail_port', 'use_ssl'): self.set_cp_value(f) - - # setup scheduler for support emails - if cint(self.doc.sync_support_mails): - if not (self.doc.support_host and self.doc.support_username and self.doc.support_password): - webnotes.msgprint("You must give the incoming POP3 settings for support emails to activiate mailbox integration", raise_exception=1) - - from webnotes.utils.scheduler import set_event - set_event('support.doctype.support_ticket.get_support_mails', 60*5, 1) - else: - from webnotes.utils.scheduler import cancel_event - cancel_event('support.doctype.support_ticket.get_support_mails') diff --git a/erpnext/support/doctype/support_ticket/__init__.py b/erpnext/support/doctype/support_ticket/__init__.py index 2a6f33c31b..557dbaedfc 100644 --- a/erpnext/support/doctype/support_ticket/__init__.py +++ b/erpnext/support/doctype/support_ticket/__init__.py @@ -140,9 +140,9 @@ class SupportMailbox(POP3Mailbox): """ Send auto reply to emails """ - signature = self.email_settings.support_signature or '' + signature = self.email_settings.fields.get('support_signature') or '' - response = self.email_settings.support_autoreply or (""" + response = self.email_settings.fields.get('support_autoreply') or (""" A new Ticket has been raised for your query. If you have any additional information, please reply back to this mail.