From 915b1d7a2884b9af25bdaafa55be1aa595eebf8d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 22 Mar 2012 11:38:31 +0530 Subject: [PATCH] focus on first input only if docstatus = 0 --- js/legacy/widgets/form/form.js | 5 ++++- py/webnotes/boot.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/legacy/widgets/form/form.js b/js/legacy/widgets/form/form.js index 715f1850bc..7a707a2296 100644 --- a/js/legacy/widgets/form/form.js +++ b/js/legacy/widgets/form/form.js @@ -583,7 +583,10 @@ _f.Frm.prototype.refresh = function(docname) { } // focus on first input - $(this.wrapper).find('.form-layout-row :input:first').focus(); + + if(this.doc.docstatus==0) { + $(this.wrapper).find('.form-layout-row :input:first').focus(); + } } else { // show print layout diff --git a/py/webnotes/boot.py b/py/webnotes/boot.py index 9c1ea98b02..b7c046dbd9 100644 --- a/py/webnotes/boot.py +++ b/py/webnotes/boot.py @@ -41,7 +41,7 @@ def get_bootinfo(): # remove email settings from control panel dict for field in ['mail_login', 'mail_password', 'mail_port', 'outgoing_mail_server', 'use_ssl']: - del cp[field] + if field in cp: del cp[field] # system info bootinfo['control_panel'] = cp.copy()