Fixes Issue 0024726: Problems with Selectors if you migrate from Openbravo 2.22
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Tue, 10 Sep 2013 16:10:38 +0530
changeset 21106 6a60136ef23f
parent 21105 3d8d31130f98
child 21107 7eada4720c21
Fixes Issue 0024726: Problems with Selectors if you migrate from Openbravo 2.22

Certain ID fields are of length 7 in mp2.2, so when using such fields, in selectors, when the whole text is typed, the text is getting replaced with the ID.
Updated OB.Utilities.isUUID method to add support for 7 digit ID fields.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Sun Sep 08 13:00:39 2013 +0530
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Tue Sep 10 16:10:38 2013 +0530
@@ -1031,9 +1031,14 @@
   if (typeof object !== 'string') {
     return false;
   }
-  if (object.length !== 32) {
+  if (object.length !== 7 && object.length !== 32) {
     return false;
   }
+  if (object.length === 32) {
+    return (/[A-Fa-f0-9]{32,32}/).test(object);
+  } else if (object.length === 7) {
+    return (/[A-Fa-f0-9]{7,7}/).test(object);
+  }
   return (/[A-Fa-f0-9]{32,32}/).test(object);
 };