fix in profile permissions and support ticket response should update modified datetime

This commit is contained in:
Anand Doshi 2012-05-24 12:39:18 +05:30
parent fcbd2ad792
commit 5fda36f2c0
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,22 @@
def execute():
"""Make profile readonly for role All"""
import webnotes.model.doc
webnotes.conn.sql("delete from `tabDocPerm` where parent='Profile' and role='All'")
new_perms = [
{
'parent': 'Profile',
'parentfield': 'permissions',
'parenttype': 'DocType',
'role': 'All',
'permlevel': 0,
'read': 1,
},
]
for perms in new_perms:
doc = webnotes.model.doc.Document('DocPerm')
doc.fields.update(perms)
doc.save()
webnotes.conn.commit()
webnotes.conn.begin()
import webnotes.model.sync
webnotes.model.sync.sync('core', 'profile')

View File

@ -397,4 +397,9 @@ patch_list = [
'patch_file': 'reload_customer_address_contact',
'description': 'Reload report customer address contact'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'profile_perm_patch',
'description': 'Make profile readonly for role All'
},
]

View File

@ -79,7 +79,12 @@ class SupportMailbox(POP3Mailbox):
st = get_obj('Support Ticket', thread_id)
st.make_response_record(content, mail.mail['From'], content_type)
webnotes.conn.set(st.doc, 'status', 'Open')
# to update modified date
#webnotes.conn.set(st.doc, 'status', 'Open')
st.doc.status = 'Open'
st.doc.save()
update_feed(st.doc, 'on_update')
webnotes.conn.commit()
# extract attachments