fixed bug 36628: can't update organization if entity has computed columns
authorAsier Lostalé <asier.lostale@openbravo.com>
Wed, 09 Aug 2017 15:27:55 +0200
changeset 32552 79642582d449
parent 32551 e6738814dcbe
child 32553 f7c49ae6cfd1
fixed bug 36628: can't update organization if entity has computed columns

Computed columns organization matches base object's organization, when org in
base one is updated, the one in computed columns does not.

When validating referenced organizations computed columns was included, failing
in this case.

As computed is a virtual entity which client and org properties are just for
convenience and they cannot be updated, it is not necessary to check for organization
correctness.
src/org/openbravo/dal/core/OBInterceptor.java
--- a/src/org/openbravo/dal/core/OBInterceptor.java	Wed Aug 09 15:24:46 2017 +0200
+++ b/src/org/openbravo/dal/core/OBInterceptor.java	Wed Aug 09 15:27:55 2017 +0200
@@ -304,6 +304,7 @@
             && bob.getEntity().getProperty(propertyNames[i]).isAllowedCrossOrgReference();
 
         if (!skipCrossOrgCheck
+            && !obObject.getEntity().isVirtualEntity()
             && !obContext.getOrganizationStructureProvider(o1.getClient().getId()).isInNaturalTree(
                 o1, o2)) {
           throw new OBSecurityException("Entity " + bob.getIdentifier() + " ("