fixes in support ticket and email settings

This commit is contained in:
Anand Doshi 2012-06-14 14:55:44 +05:30
parent 4c56275d26
commit 92fd9cce35
4 changed files with 36 additions and 5 deletions

View File

@ -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)

View File

@ -432,4 +432,9 @@ patch_list = [
'patch_file': 'reports_list_permission', 'patch_file': 'reports_list_permission',
'description': 'allow read permission to all for report list' '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'
},
] ]

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2012-03-27 14:36:20', 'creation': '2012-05-15 12:15:01',
'docstatus': 0, 'docstatus': 0,
'modified': '2012-03-27 14:36:20', 'modified': '2012-06-14 14:47:49',
'modified_by': u'Administrator', 'modified_by': u'Administrator',
'owner': u'harshada@webnotestech.com' 'owner': u'harshada@webnotestech.com'
}, },
@ -25,7 +25,7 @@
'name': '__common__', 'name': '__common__',
'section_style': u'Simple', 'section_style': u'Simple',
'server_code_error': u' ', 'server_code_error': u' ',
'version': 35 'version': 1
}, },
# These values are common for all DocField # These values are common for all DocField
@ -230,6 +230,16 @@
'label': u'Signature' 'label': u'Signature'
}, },
# DocField
{
'colour': u'White:FFF',
'default': u'1',
'doctype': u'DocField',
'fieldname': u'send_autoreply',
'fieldtype': u'Check',
'label': u'Send Autoreply'
},
# DocField # DocField
{ {
'colour': u'White:FFF', 'colour': u'White:FFF',
@ -237,6 +247,6 @@
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'support_autoreply', 'fieldname': u'support_autoreply',
'fieldtype': u'Text', 'fieldtype': u'Text',
'label': u'Autoreply' 'label': u'Custom Autoreply Message'
} }
] ]

View File

@ -177,5 +177,6 @@ def get_support_mails():
Gets new emails from support inbox and updates / creates Support Ticket records Gets new emails from support inbox and updates / creates Support Ticket records
""" """
import webnotes 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() SupportMailbox().get_messages()