added patch for expense and leave
diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js
index 09befee..d3bde12 100644
--- a/home/page/latest_updates/latest_updates.js
+++ b/home/page/latest_updates/latest_updates.js
@@ -1,5 +1,7 @@
erpnext.updates = [
["5th December 2012", [
+ "Leave Application: Now can set approver.",
+ "New Roles Added: Leave Approver and Expense Approver.",
"Production Order is now linked with sales order.",
"Production Planning Tool: The field 'Allow SA items as raw material' has been renamed to 'Use multi-level BOM', 'Include in plan' column from SO table has been deleted",
"Batch nos are now filtered with item and available qty",
diff --git a/patches/december_2012/expense_leave_reload.py b/patches/december_2012/expense_leave_reload.py
index f96e5a6..a3c621f 100644
--- a/patches/december_2012/expense_leave_reload.py
+++ b/patches/december_2012/expense_leave_reload.py
@@ -1,12 +1,23 @@
import webnotes
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 '""")