Fixes issue 24156: Create Shipments from Order:
authorJavier Etxarri <javier.echarri@openbravo.com>
Thu, 26 Sep 2013 02:19:19 +0200
changeset 21198 30de8abef686
parent 21197 19a6d9616141
child 21199 9aafa9f00956
child 21200 c6dbf71135bc
Fixes issue 24156: Create Shipments from Order:
Organization filter incorrect
src/org/openbravo/erpCommon/ad_forms/GenerateShipmentsmanual.java
--- a/src/org/openbravo/erpCommon/ad_forms/GenerateShipmentsmanual.java	Thu Sep 26 01:34:23 2013 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/GenerateShipmentsmanual.java	Thu Sep 26 02:19:19 2013 +0200
@@ -125,11 +125,16 @@
     } else {
       xmlDocument = xmlEngine.readXmlTemplate(
           "org/openbravo/erpCommon/ad_forms/GenerateShipmentsmanual").createXmlDocument();
-      data = GenerateShipmentsmanualData.select(this, vars.getLanguage(),
+      data = GenerateShipmentsmanualData.select(
+          this,
+          vars.getLanguage(),
           Utility.getContext(this, vars, "#User_Client", "GenerateShipmentsmanual"),
-          Utility.getContext(this, vars, "#User_Org", "GenerateShipmentsmanual"), strC_BPartner_ID,
-          strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"),
-          Tree.getMembers(this, strTreeOrg, strAD_Org_ID));
+          Utility.getContext(this, vars, "#User_Org", "GenerateShipmentsmanual"),
+          strC_BPartner_ID,
+          strDateFrom,
+          DateTimeData.nDaysAfter(this, strDateTo, "1"),
+          (strAD_Org_ID == null || strAD_Org_ID.isEmpty()) ? Tree.getMembers(this, strTreeOrg,
+              strAD_Org_ID) : "'" + strAD_Org_ID + "'");
     }
 
     ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "GenerateShipmentsmanual", false, "",