details:   /erp/devel/pi/rev/40eaf826d462
changeset: 12122:40eaf826d462
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu May 12 10:28:21 2011 +0200
summary:   fixed bug 17070: Reconcilliation child tab (cleared items) is not 
filtered by parent

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
 |  19 ++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diffs (43 lines):

diff -r 999211f9625a -r 40eaf826d462 
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
       Thu May 12 10:00:22 2011 +0200
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
       Thu May 12 10:28:21 2011 +0200
@@ -27,6 +27,7 @@
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
+import org.openbravo.client.kernel.KernelUtils;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -35,6 +36,7 @@
 import org.openbravo.model.ad.access.RoleOrganization;
 import org.openbravo.model.ad.access.User;
 import org.openbravo.model.ad.access.UserRoles;
+import org.openbravo.model.ad.datamodel.Column;
 import org.openbravo.model.ad.ui.Field;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
@@ -146,6 +148,23 @@
         }
       }
     }
+
+    // handle a special case: it is possible to define a column in the child 
tab to be linked to a
+    // secondary key in the parent tab
+    if (returnProperty == null) {
+      for (Column parentCol : parentTab.getTable().getADColumnList()) {
+        if (!parentCol.isSecondaryKey()) {
+          continue;
+        }
+        for (Column childCol : tab.getTable().getADColumnList()) {
+          if (childCol.isLinkToParentColumn()
+              && 
childCol.getDBColumnName().equalsIgnoreCase(parentCol.getDBColumnName())) {
+            returnProperty = 
KernelUtils.getInstance().getPropertyFromColumn(childCol);
+          }
+        }
+      }
+    }
+
     return (returnProperty != null ? returnProperty.getName() : "");
   }
 

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to