fix in profile permissions and support ticket response should update modified datetime
This commit is contained in:
parent
fcbd2ad792
commit
5fda36f2c0
22
erpnext/patches/may_2012/profile_perm_patch.py
Normal file
22
erpnext/patches/may_2012/profile_perm_patch.py
Normal 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')
|
@ -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'
|
||||
},
|
||||
]
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user