From 36fc1d06fb51cf3e60bb5ecfbaef7068920f84e2 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 4 Nov 2011 10:41:12 +0530 Subject: [PATCH] appriasal copy fix --- erpnext/hr/doctype/appraisal/appraisal.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js index b2683d82de..be9cefbf3a 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.js +++ b/erpnext/hr/doctype/appraisal/appraisal.js @@ -1,13 +1,21 @@ cur_frm.add_fetch('employee', 'company', 'company'); cur_frm.cscript.onload = function(doc,cdt,cdn){ - if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); - if(doc.employee) cur_frm.cscript.employee(doc,cdt,cdn); - if(doc.amended_from && doc.__islocal) cur_frm.cscript.refresh_appraisal_details(doc, cdt, cdn); + if(doc.employee) + cur_frm.cscript.employee(doc,cdt,cdn); + if(doc.amended_from && doc.__islocal) + cur_frm.cscript.refresh_appraisal_details(doc, cdt, cdn); +} + +cur_frm.cscript.onload_post_render = function(doc,cdt,cdn){ + if(doc.employee) + cur_frm.cscript.employee(doc,cdt,cdn); } cur_frm.cscript.refresh = function(doc,cdt,cdn){ - if(user == doc.kra_approver && doc.status == 'Submitted') unhide_field(['Update', 'Declare Completed', 'Calculate Total Score']); + if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); + if(user == doc.kra_approver && doc.status == 'Submitted') + unhide_field(['Update', 'Declare Completed', 'Calculate Total Score']); else hide_field(['Update', 'Declare Completed', 'Calculate Total Score']); if(!doc.docstatus) unhide_field('Fetch Template');