diff --git a/erpnext/patches/jan_mar_2012/email_settings_reload.py b/erpnext/patches/jan_mar_2012/email_settings_reload.py new file mode 100644 index 00000000000..bfe3efeae95 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/email_settings_reload.py @@ -0,0 +1,13 @@ +def execute(): + """ + * Change type of mail_port field to int + * reload email settings + """ + import webnotes + webnotes.conn.sql(""" + UPDATE `tabDocField` SET fieldtype='Int' + WHERE parent = 'Email Settings' AND fieldname = 'mail_port' + """) + + from webnotes.modules.module_manager import reload_doc + reload_doc('setup', 'doctype', 'email_settings') diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 2193207837e..d56ba2f8472 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -45,4 +45,9 @@ patch_list = [ 'patch_file': 'doclabel_in_doclayer', 'description': "Show DocType Labels instead of DocType names in Customize Form View" }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'email_settings_reload', + 'description': "Change type of mail_port field to Int and reload email_settings doctype" + }, ] diff --git a/erpnext/setup/doctype/email_settings/email_settings.py b/erpnext/setup/doctype/email_settings/email_settings.py index 4c45a77dafb..c5e6a8e6a13 100644 --- a/erpnext/setup/doctype/email_settings/email_settings.py +++ b/erpnext/setup/doctype/email_settings/email_settings.py @@ -71,7 +71,7 @@ class DocType: """ Checks support ticket email settings """ - if self.doc.support_host: + if self.doc.sync_support_mails and self.doc.support_host: from webnotes.utils.email_lib.receive import POP3Mailbox from webnotes.model.doc import Document import _socket, poplib