brotherton-erpnext/patches/february_2013/p05_leave_application.py

9 lines
339 B
Python

import webnotes
def execute():
webnotes.reload_doc("hr", "doctype", "leave_application")
if not webnotes.get_doctype("Leave Application").get({"doctype": "DocField",
"parent": "Leave Application", "permlevel": 2}):
webnotes.conn.sql("""update `tabDocPerm` set permlevel=1
where parent="Leave Application" and permlevel=2""")