From 8347aad4020267d0f257dc0be1193e18e41ae9c1 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 20 Mar 2012 14:54:25 +0530 Subject: [PATCH] email settings separated from control panel --- .../doctype/email_settings/email_settings.js | 21 ----------------- .../doctype/email_settings/email_settings.py | 23 ------------------- 2 files changed, 44 deletions(-) delete mode 100644 erpnext/setup/doctype/email_settings/email_settings.js diff --git a/erpnext/setup/doctype/email_settings/email_settings.js b/erpnext/setup/doctype/email_settings/email_settings.js deleted file mode 100644 index 599fbcc6cf..0000000000 --- a/erpnext/setup/doctype/email_settings/email_settings.js +++ /dev/null @@ -1,21 +0,0 @@ -// ERPNext - web based ERP (http://erpnext.com) -// Copyright (C) 2012 Web Notes Technologies Pvt Ltd -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -cur_frm.cscript.refresh = function(doc,cdt,cdn){ - if(!doc.outgoing_mail_server || !doc.mail_login || !doc.mail_password || !doc.auto_email_id || !doc.mail_port || !doc.use_ssl){ - get_server_fields('set_vals','','',doc, cdt, cdn, 1); - } -} \ No newline at end of file diff --git a/erpnext/setup/doctype/email_settings/email_settings.py b/erpnext/setup/doctype/email_settings/email_settings.py index c670b317c9..3e17636b39 100644 --- a/erpnext/setup/doctype/email_settings/email_settings.py +++ b/erpnext/setup/doctype/email_settings/email_settings.py @@ -23,21 +23,6 @@ class DocType: def __init__(self,doc,doclist): self.doc,self.doclist = doc,doclist - def set_vals(self): - res = sql("select field, value from `tabSingles` where doctype = 'Control Panel' and field IN ('outgoing_mail_server','mail_login','mail_password','auto_email_id','mail_port','use_ssl')") - ret = {} - for r in res: - ret[cstr(r[0])]=r[1] and cstr(r[1]) or '' - - return ret - - def set_cp_value(self, key): - """ - Update value in control panel - """ - webnotes.conn.set_value('Control Panel', None, key, - self.doc.fields.get(key)) - def validate(self): """ Checks connectivity to email servers before saving @@ -113,11 +98,3 @@ class DocType: except poplib.error_proto, e: webnotes.msgprint('Invalid User Name or Support Password. Please rectify and try again.') webnotes.msgprint(e) - - - def on_update(self): - """ - 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)