message updates in Leave / Expense, catch localstorage error

This commit is contained in:
Rushabh Mehta 2012-12-05 17:06:07 +05:30
parent 38f19104d8
commit ed29af98a9
3 changed files with 5 additions and 11 deletions

View File

@ -53,17 +53,13 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){
cur_frm.set_intro("Fill the form and save it")
} else {
if(doc.approval_status=="Draft") {
if(in_list(user_roles, "HR User")) {
if(doc.approval_status=="Draft") {
cur_frm.set_intro("Please Approve (and Submit) or Reject, or re-assign to applicant for further review.");
}
} else if(user==doc.exp_approver) {
if(user==doc.exp_approver) {
if(doc.approval_status=="Draft") {
cur_frm.set_intro("You are the Expense Approver for this record. Please Update the 'Status' and Save");
cur_frm.set_df_property("approval_status", "permlevel", 0);
}
} else {
cur_frm.set_intro("Expense Claim is pending approval.");
cur_frm.set_intro("Expense Claim is pending approval. Only the Expense Approver can update status.");
}
} else {
if(doc.approval_status=="Approved") {

View File

@ -31,13 +31,11 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
cur_frm.set_intro("Fill the form and save it")
} else {
if(doc.status=="Open") {
if(in_list(user_roles, "HR User")) {
cur_frm.set_intro("Please Approve (and Submit) or Reject, or re-assign to applicant for further review.");
} else if(user==doc.leave_approver) {
if(user==doc.leave_approver) {
cur_frm.set_intro("You are the Leave Approver for this record. Please Update the 'Status' and Save");
cur_frm.set_df_property("status", "permlevel", 2);
} else {
cur_frm.set_intro("This Leave Application is pending approval.")
cur_frm.set_intro("This Leave Application is pending approval. Only the Leave Apporver can update status.")
}
} else {
if(doc.status=="Approved") {

View File

@ -2,7 +2,7 @@ import webnotes
def execute():
# new roles
roles = [r[0] for r in webnotes.conn.sql("""select name from tabRole""")]:
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()