fixes in support ticket and email settings
diff --git a/erpnext/patches/june_2012/support_ticket_autoreply.py b/erpnext/patches/june_2012/support_ticket_autoreply.py
new file mode 100644
index 0000000..cdb47a2
--- /dev/null
+++ b/erpnext/patches/june_2012/support_ticket_autoreply.py
@@ -0,0 +1,15 @@
+def execute():
+ """New Send Autoreply checkbox in Email Settings"""
+ import webnotes
+ import webnotes.utils
+
+ import webnotes.model.sync
+ webnotes.conn.commit()
+ webnotes.model.sync.sync('setup', 'email_settings')
+ webnotes.conn.begin()
+
+ sync_support_mails = webnotes.utils.cint(webnotes.conn.get_value('Email Settings',
+ None, 'sync_support_mails'))
+
+ if sync_support_mails:
+ webnotes.conn.set_value('Email Settings', None, 'send_autoreply', 1)
\ No newline at end of file
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index b471780..87c96c1 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -432,4 +432,9 @@
'patch_file': 'reports_list_permission',
'description': 'allow read permission to all for report list'
},
+ {
+ 'patch_module': 'patches.june_2012',
+ 'patch_file': 'support_ticket_autoreply',
+ 'description': 'New Send Autoreply checkbox in Email Settings'
+ },
]
\ No newline at end of file
diff --git a/erpnext/setup/doctype/email_settings/email_settings.txt b/erpnext/setup/doctype/email_settings/email_settings.txt
index fdf1cf0..2772367 100644
--- a/erpnext/setup/doctype/email_settings/email_settings.txt
+++ b/erpnext/setup/doctype/email_settings/email_settings.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-03-27 14:36:20',
+ 'creation': '2012-05-15 12:15:01',
'docstatus': 0,
- 'modified': '2012-03-27 14:36:20',
+ 'modified': '2012-06-14 14:47:49',
'modified_by': u'Administrator',
'owner': u'harshada@webnotestech.com'
},
@@ -25,7 +25,7 @@
'name': '__common__',
'section_style': u'Simple',
'server_code_error': u' ',
- 'version': 35
+ 'version': 1
},
# These values are common for all DocField
@@ -233,10 +233,20 @@
# DocField
{
'colour': u'White:FFF',
+ 'default': u'1',
+ 'doctype': u'DocField',
+ 'fieldname': u'send_autoreply',
+ 'fieldtype': u'Check',
+ 'label': u'Send Autoreply'
+ },
+
+ # DocField
+ {
+ 'colour': u'White:FFF',
'description': u'Autoreply when a new mail is received',
'doctype': u'DocField',
'fieldname': u'support_autoreply',
'fieldtype': u'Text',
- 'label': u'Autoreply'
+ 'label': u'Custom Autoreply Message'
}
]
\ No newline at end of file
diff --git a/erpnext/support/doctype/support_ticket/__init__.py b/erpnext/support/doctype/support_ticket/__init__.py
index d2dbe60..7335dad 100644
--- a/erpnext/support/doctype/support_ticket/__init__.py
+++ b/erpnext/support/doctype/support_ticket/__init__.py
@@ -177,5 +177,6 @@
Gets new emails from support inbox and updates / creates Support Ticket records
"""
import webnotes
- if webnotes.conn.get_value('Email Settings', None, 'sync_support_mails'):
+ from webnotes.utils import cint
+ if cint(webnotes.conn.get_value('Email Settings', None, 'sync_support_mails')):
SupportMailbox().get_messages()
\ No newline at end of file