def execute(): # new roles roles = [r[0] for r in webnotes.conn.sql("""select name from tabRole""")] if not "Leave Approver" in roles: webnotes.bean([{ "doctype": "Role", "role_name": "Leave Approver", "__islocal": 1, "module": "HR" }]).save() if not "Expense Approver" in roles: webnotes.bean([{ "doctype": "Role", "role_name": "Expense Approver", "__islocal": 1, "module": "HR" }]).save() # reload webnotes.clear_perms("Leave Application") webnotes.reload_doc("hr", "doctype", "leave_application") webnotes.clear_perms("Expense Claim") webnotes.reload_doc("hr", "doctype", "expense_claim") # remove extra space in Approved Expense Vouchers webnotes.conn.sql( """update `tabExpense Claim` set approval_status='Approved' where approval_status='Approved '""") webnotes.conn.commit() for t in ['__CacheItem', '__SessionCache', 'tabSupport Ticket Response']: webnotes.conn.sql("drop table if exists `%s`" % t)
def execute(): webnotes.clear_perms("Leave Application") webnotes.reload_doc("hr", "doctype", "leave_application") webnotes.conn.sql("""update `tabLeave Application` set status='Approved' where docstatus=1""") webnotes.conn.sql("""update `tabLeave Application` set status='Open' where docstatus=0""")
def execute(): webnotes.reload_doc("core", "doctype", "doctype") webnotes.clear_perms("Leave Application") webnotes.reload_doc("hr", "doctype", "leave_application") webnotes.conn.sql("""update `tabLeave Application` set status='Approved' where docstatus=1""") webnotes.conn.sql("""update `tabLeave Application` set status='Open' where docstatus=0""")
def execute(): webnotes.clear_perms("Profile") webnotes.reload_doc("core", "doctype", "profile") webnotes.conn.sql("""delete from `tabDefaultValue` where defkey='theme'""") webnotes.delete_doc("Page", "profile-settings") return for name in webnotes.conn.sql("""select name from tabProfile"""): theme = webnotes.conn.get_default("theme", name[0]) if theme: webnotes.conn.set_value("Profile", name[0], "theme", theme)
def execute(): # new roles roles = [r[0] for r in webnotes.conn.sql("""select name from tabRole""")] if not "Leave Approver" in roles: webnotes.model_wrapper([{"doctype":"Role", "role_name":"Leave Approver", "__islocal":1, "module":"HR"}]).save() if not "Expense Approver" in roles: webnotes.model_wrapper([{"doctype":"Role", "role_name":"Expense Approver", "__islocal":1, "module":"HR"}]).save() # reload webnotes.clear_perms("Leave Application") webnotes.reload_doc("hr", "doctype", "leave_application") webnotes.clear_perms("Expense Claim") webnotes.reload_doc("hr", "doctype", "expense_claim") # remove extra space in Approved Expense Vouchers webnotes.conn.sql("""update `tabExpense Claim` set approval_status='Approved' where approval_status='Approved '""") webnotes.conn.commit() for t in ['__CacheItem', '__SessionCache', 'tabSupport Ticket Response']: webnotes.conn.sql("drop table if exists `%s`" % t)
def execute(): webnotes.clear_perms("Employee") webnotes.reload_doc("hr", "doctype", "employee") webnotes.conn.sql("""update tabEmployee set employee=name""")
def execute(): webnotes.clear_perms("Report") webnotes.clear_perms("ToDo") webnotes.reload_doc("core", "doctype", "report") webnotes.reload_doc("core", "doctype", "todo") webnotes.reload_doc("core", "report", "todo")