details:   /erp/devel/pi/rev/03f21336f3da
changeset: 11156:03f21336f3da
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Wed Mar 09 12:34:16 2011 -0600
summary:   Fixes issue 16174 Smoke test: when trying to create a line for a 
second price list schema, buttons are disabled

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
 |  11 ++++-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  21 ++++++++-
 2 files changed, 27 insertions(+), 5 deletions(-)

diffs (69 lines):

diff -r 5d6088b23934 -r 03f21336f3da 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Wed Mar 09 19:00:50 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Wed Mar 09 12:34:16 2011 -0600
@@ -768,9 +768,16 @@
       var index1, index2, errorCode, view = form.view;
       var status = resp.status;
 
-      // if this is not done the selection gets lost
+      // if no recordIndex then select explicitly
+      if (recordIndex === -1) {
+        var id = form.getValue('id');
+        record = view.viewGrid.data.find('id', id);
+        recordIndex = view.viewGrid.data.indexOf(record);
+      }
+      
       if (recordIndex || recordIndex === 0) {
-        var localRecord = view.viewGrid.getRecord(recordIndex);
+        // if this is not done the selection gets lost
+        var localRecord = view.viewGrid.data.get(recordIndex);
         if (localRecord) {
           localRecord[view.viewGrid.selection.selectionProperty] = true;
         }
diff -r 5d6088b23934 -r 03f21336f3da 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Wed Mar 09 19:00:50 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Wed Mar 09 12:34:16 2011 -0600
@@ -451,8 +451,7 @@
     }
     
     var context = {
-      showPrompt: false,
-      textMatchStyle: this.autoFetchTextMatchStyle
+      showPrompt: false
     };
     this.filterData(this.getCriteria(), callback, context);
   },
@@ -715,8 +714,24 @@
         operator: 'and', 
         _constructor: "AdvancedCriteria", 
         criteria:[]};
+        
+      // add a dummy criteria to force a fetch
+      criteria.criteria.push({
+        fieldName: '_dummy',
+        operator: 'equals',
+        value: this.targetRecordId
+      });
+      
       // remove the filter clause we don't want to use
       this.filterClause = null;
+    } else {
+      // remove the _dummy
+      for (i = 0; i < criteria.criteria.length; i++) {
+        if (criteria.criteria[i].fieldName === '_dummy') {
+          criteria.criteria.removeAt(i);
+          break;
+        }
+      }
     }
     
     // note pass in criteria otherwise infinite looping!
@@ -758,7 +773,7 @@
       for (i = (internalCriteria.length - 1); i >= 0; i--) {
         var shouldRemove = false;
         criterion = internalCriteria[i];
-        if (criterion.fieldName && criterion.fieldName.startsWith('_')) {
+        if (criterion.fieldName && criterion.fieldName.startsWith('_') && 
criterion.fieldName !== '_dummy') {
           shouldRemove = true;
         } else if (isc.isA.emptyString(criterion.value)) {
           shouldRemove = true;

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to