details:   https://code.openbravo.com/erp/devel/pi/rev/9975d9061252
changeset: 35460:9975d9061252
user:      Álvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Wed Feb 20 14:05:02 2019 +0100
summary:   Fixes issue 40244: Do not check crossReferenceOrg for audit columns

diffstat:

 src/org/openbravo/dal/core/OBInterceptor.java |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 4d918d964e28 -r 9975d9061252 
src/org/openbravo/dal/core/OBInterceptor.java
--- a/src/org/openbravo/dal/core/OBInterceptor.java     Wed Feb 20 09:46:02 
2019 +0530
+++ b/src/org/openbravo/dal/core/OBInterceptor.java     Wed Feb 20 14:05:02 
2019 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2018 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2019 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -281,7 +281,7 @@
       if ((isNew || currentState[i] != previousState[i])
           && !(currentState[i] instanceof Organization)
           && (currentState[i] instanceof BaseOBObject || currentState[i] 
instanceof HibernateProxy)
-          && currentState[i] instanceof OrganizationEnabled) {
+          && currentState[i] instanceof OrganizationEnabled && 
!isAudit(propertyNames[i])) {
         // get the organization from the current state
         final OrganizationEnabled oe = (OrganizationEnabled) currentState[i];
         final Organization o2 = oe.getOrganization();
@@ -317,6 +317,10 @@
     }
   }
 
+  private boolean isAudit(final String propertyName) {
+    return propertyName.equalsIgnoreCase("createdBy") || 
propertyName.equalsIgnoreCase("updatedBy");
+  }
+
   // general event handler does new and update
   protected void doEvent(Object object, Object[] currentState, String[] 
propertyNames) {
     try {


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to