# HG changeset patch
# User Shankar Balachandran <shankar.balachandran@openbravo.com>
# Date 1358320253 0
# Node ID 87940aea42ce8dc4b873a926092070b3eb8dc478
# Parent  ed4bf9f626710cca1f3732b4905bfc601bef830c
Fixes Issue 0022423: Wrong focus after CTRL+D keyboard shortcut

When navigating across records, the last selected field needs to be focussed.
But this case need not apply for new records. Added additional constraint to achieve the same.

diff -r ed4bf9f62671 -r 87940aea42ce modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Fri Jan 11 14:29:51 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Wed Jan 16 07:10:53 2013 +0000
@@ -1574,7 +1574,7 @@
 
       form.isSaving = false;
       view.toolBar.updateButtonState(true);
-      if (form.isVisible() && storedFocusItem && storedFocusItem.isFocusable(true)) {
+      if (form.isVisible() && storedFocusItem && storedFocusItem.isFocusable(true) && !this.view.viewForm.isNewRecord()) {
         // The setTimeout fixes issue https://issues.openbravo.com/view.php?id=21546
         // that is only reproducible in certain versions of Chrome
         setTimeout(function () {
