leave application: status no_copy and draft on Open

This commit is contained in:
Rushabh Mehta 2012-12-07 10:25:07 +05:30
parent 2fd32859e7
commit 0ea130a97c
2 changed files with 9 additions and 2 deletions

View File

@ -19,6 +19,9 @@ cur_frm.add_fetch('employee','employee_name','employee_name');
cur_frm.cscript.onload = function(doc, dt, dn) { cur_frm.cscript.onload = function(doc, dt, dn) {
if(!doc.posting_date) if(!doc.posting_date)
set_multiple(dt,dn,{posting_date:get_today()}); set_multiple(dt,dn,{posting_date:get_today()});
if(doc.__islocal) {
cur_frm.set_value("status", "Open")
}
cur_frm.call({ cur_frm.call({
method:"get_approver_list", method:"get_approver_list",
callback: function(r) { callback: function(r) {
@ -29,6 +32,9 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
} }
cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.cscript.refresh = function(doc, dt, dn) {
if(doc.__islocal) {
cur_frm.set_value("status", "Open")
}
cur_frm.set_intro(""); cur_frm.set_intro("");
if(doc.__islocal && !in_list(user_roles, "HR User")) { if(doc.__islocal && !in_list(user_roles, "HR User")) {
cur_frm.set_intro("Fill the form and save it") cur_frm.set_intro("Fill the form and save it")

View File

@ -2,9 +2,9 @@
{ {
"owner": "Administrator", "owner": "Administrator",
"docstatus": 0, "docstatus": 0,
"creation": "2012-12-05 14:11:53", "creation": "2012-12-06 15:56:41",
"modified_by": "Administrator", "modified_by": "Administrator",
"modified": "2012-12-05 17:38:26" "modified": "2012-12-07 10:23:53"
}, },
{ {
"is_submittable": 1, "is_submittable": 1,
@ -39,6 +39,7 @@
"colour": "White:FFF", "colour": "White:FFF",
"doctype": "DocField", "doctype": "DocField",
"label": "Status", "label": "Status",
"no_copy": 1,
"options": "Open\nApproved\nRejected", "options": "Open\nApproved\nRejected",
"fieldname": "status", "fieldname": "status",
"fieldtype": "Select", "fieldtype": "Select",