details:   https://code.openbravo.com/erp/devel/pi/rev/225d04f42766
changeset: 33914:225d04f42766
user:      Armaignac <collazoandy4 <at> gmail.com>
date:      Mon Apr 30 08:23:08 2018 -0400
summary:   Fixes issue 38316:Warehouse in context (session) is different from 
the warehouse
on the login in some circumstances, could affect tax selection

Under some circumstances the warehouse in the session is different from the 
warehouse
on the login that could affect tax selection

Now in case there does not exist any warehouse defined for the specific 
organization
one is selected from the organization natural tree

diffstat:

 src/org/openbravo/base/secureApp/LoginUtils.java |  11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (30 lines):

diff -r 3d4d46f2c932 -r 225d04f42766 
src/org/openbravo/base/secureApp/LoginUtils.java
--- a/src/org/openbravo/base/secureApp/LoginUtils.java  Thu May 03 10:58:06 
2018 +0200
+++ b/src/org/openbravo/base/secureApp/LoginUtils.java  Mon Apr 30 08:23:08 
2018 -0400
@@ -13,7 +13,6 @@
 
 import java.io.File;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -625,15 +624,11 @@
 
         OrganizationStructureProvider osp = OBContext.getOBContext()
             .getOrganizationStructureProvider(strClient);
-        Set<String> allAccessibleOrgs = new HashSet<>();
 
-        for (OrgTreeData org : OrgTreeData.select(connectionProvider, 
strRole)) {
-          if (!allAccessibleOrgs.contains(org.adOrgId)) {
-            allAccessibleOrgs.addAll(osp.getNaturalTree(org.adOrgId));
-          }
-        }
+        Set<String> orgNaturalTree = osp.getNaturalTree(strOrg);
+
         strWarehouse = 
DefaultOptionsData.getDefaultWarehouse(connectionProvider, strClient,
-            StringCollectionUtils.commaSeparated(allAccessibleOrgs));
+            StringCollectionUtils.commaSeparated(orgNaturalTree));
       }
     } else {
       strWarehouse = "";

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to