details:   https://code.openbravo.com/erp/devel/pi/rev/83a63cbaa7f0
changeset: 35243:83a63cbaa7f0
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Fri Dec 14 10:49:32 2018 +0530
summary:   Fixes Issue 39773: If a role has access to a parent org and
does not have access to a child org, can see the orders in
Goods Receipts window

** Child organization documents should not be used to create
linked documents in parent organizations.
** Use organization tree used to load order lines when
loaded order header

diffstat:

 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java |  45 ++++++------
 1 files changed, 24 insertions(+), 21 deletions(-)

diffs (74 lines):

diff -r 8863172bda3f -r 83a63cbaa7f0 
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java       Fri Dec 
14 10:46:55 2018 +0530
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java       Fri Dec 
14 10:49:32 2018 +0530
@@ -43,11 +43,9 @@
 import org.openbravo.erpCommon.utility.ComboTableData;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.SequenceIdData;
-import org.openbravo.erpCommon.utility.StringCollectionUtils;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.materialmgmt.UOMUtil;
 import org.openbravo.model.common.invoice.Invoice;
-import org.openbravo.model.materialmgmt.transaction.ShipmentInOut;
 import org.openbravo.utils.Replace;
 import org.openbravo.xmlEngine.XmlDocument;
 
@@ -457,7 +455,6 @@
     XmlDocument xmlDocument;
     String strPO = vars.getStringParameter("inpPurchaseOrder");
     String strInvoice = vars.getStringParameter("inpInvoice");
-    ShipmentInOut shipment = OBDal.getInstance().get(ShipmentInOut.class, 
strKey);
     final String strLocator = vars.getStringParameter("inpmLocatorId");
     final String isSOTrx = Utility.getContext(this, vars, "isSOTrx", 
strWindowId);
     if (vars.commandIn("FIND_PO"))
@@ -550,26 +547,32 @@
       xmlDocument.setData("reportInvoice", "liststructure", new 
CreateFromShipmentData[0]);
       xmlDocument.setData("reportPurchaseOrder", "liststructure", new 
CreateFromShipmentData[0]);
     } else {
-      String narturalOrgTreeList = 
StringCollectionUtils.commaSeparated(OBContext.getOBContext()
-          
.getOrganizationStructureProvider().getNaturalTree(shipment.getOrganization().getId()));
       if (isSOTrx.equals("Y")) {
-        xmlDocument.setData("reportInvoice", "liststructure", 
CreateFromShipmentData
-            .selectFromInvoiceTrxCombo(this, vars.getLanguage(),
-                Utility.getContext(this, vars, "#User_Client", strWindowId), 
narturalOrgTreeList,
-                strBPartner));
-        xmlDocument.setData("reportPurchaseOrder", "liststructure", 
CreateFromShipmentData
-            .selectFromPOSOTrxCombo(this, vars.getLanguage(),
-                Utility.getContext(this, vars, "#User_Client", strWindowId), 
narturalOrgTreeList,
-                strBPartner));
+        xmlDocument.setData(
+            "reportInvoice",
+            "liststructure",
+            CreateFromShipmentData.selectFromInvoiceTrxCombo(this, 
vars.getLanguage(),
+                Utility.getContext(this, vars, "#User_Client", strWindowId),
+                Utility.getContext(this, vars, "#User_Org", strWindowId), 
strBPartner));
+        xmlDocument.setData(
+            "reportPurchaseOrder",
+            "liststructure",
+            CreateFromShipmentData.selectFromPOSOTrxCombo(this, 
vars.getLanguage(),
+                Utility.getContext(this, vars, "#User_Client", strWindowId),
+                Utility.getContext(this, vars, "#User_Org", strWindowId), 
strBPartner));
       } else {
-        xmlDocument.setData("reportInvoice", "liststructure", 
CreateFromShipmentData
-            .selectFromInvoiceCombo(this, vars.getLanguage(),
-                Utility.getContext(this, vars, "#User_Client", strWindowId), 
narturalOrgTreeList,
-                strBPartner));
-        xmlDocument.setData("reportPurchaseOrder", "liststructure", 
CreateFromShipmentData
-            .selectFromPOCombo(this, vars.getLanguage(),
-                Utility.getContext(this, vars, "#User_Client", strWindowId), 
narturalOrgTreeList,
-                strBPartner));
+        xmlDocument.setData(
+            "reportInvoice",
+            "liststructure",
+            CreateFromShipmentData.selectFromInvoiceCombo(this, 
vars.getLanguage(),
+                Utility.getContext(this, vars, "#User_Client", strWindowId),
+                Utility.getContext(this, vars, "#User_Org", strWindowId), 
strBPartner));
+        xmlDocument.setData(
+            "reportPurchaseOrder",
+            "liststructure",
+            CreateFromShipmentData.selectFromPOCombo(this, vars.getLanguage(),
+                Utility.getContext(this, vars, "#User_Client", strWindowId),
+                Utility.getContext(this, vars, "#User_Org", strWindowId), 
strBPartner));
       }
     }
 


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

Reply via email to