details:   https://code.openbravo.com/erp/devel/pi/rev/9ccfd2754c6a
changeset: 17537:9ccfd2754c6a
user:      Mikel Irurita <mikel.irurita <at> openbravo.com>
date:      Tue Jul 24 18:47:18 2012 +0200
summary:   Related to issue 20585: change RMShipmentPickEditLines and 
SRMOPickEditLines.
Same problem was affecting Return to Vendor Shipment and Return Material 
Receipt.
When the focus is NOT in the tab of the button (i.e. any child tab) and the tab 
does not
contain any record, the inpcXXXXId parameter contains null string. Use table 
primary key
column name instead (i.e. C_Order_ID, M_InOut_ID, ...) because it always 
contains the id of the selected
header record.

diffstat:

 src/org/openbravo/common/actionhandler/RMInOutPickEditLines.java    |  8 
++++++--
 src/org/openbravo/common/actionhandler/RMShipmentPickEditLines.java |  8 
++++++--
 src/org/openbravo/common/actionhandler/SRMOPickEditLines.java       |  4 ++++
 3 files changed, 16 insertions(+), 4 deletions(-)

diffs (64 lines):

diff -r 6d9538a0098a -r 9ccfd2754c6a 
src/org/openbravo/common/actionhandler/RMInOutPickEditLines.java
--- a/src/org/openbravo/common/actionhandler/RMInOutPickEditLines.java  Tue Jul 
24 17:42:36 2012 +0200
+++ b/src/org/openbravo/common/actionhandler/RMInOutPickEditLines.java  Tue Jul 
24 18:47:18 2012 +0200
@@ -51,7 +51,11 @@
     try {
       jsonRequest = new JSONObject(content);
       log.debug(jsonRequest);
-      final String strInOutId = jsonRequest.getString("inpmInoutId");
+      // When the focus is NOT in the tab of the button (i.e. any child tab) 
and the tab does not
+      // contain any record, the inpmInoutId parameter contains "null" string. 
Use M_InOut_ID
+      // instead because it always contains the id of the selected goods.
+      // Issue 20585: https://issues.openbravo.com/view.php?id=20585
+      final String strInOutId = jsonRequest.getString("M_InOut_ID");
       ShipmentInOut inOut = OBDal.getInstance().get(ShipmentInOut.class, 
strInOutId);
       if (cleanInOutLines(inOut)) {
         createInOutLines(jsonRequest);
@@ -89,7 +93,7 @@
     if (selectedLines.length() == 0) {
       return;
     }
-    final String strInOutId = jsonRequest.getString("inpmInoutId");
+    final String strInOutId = jsonRequest.getString("M_InOut_ID");
     ShipmentInOut inOut = OBDal.getInstance().get(ShipmentInOut.class, 
strInOutId);
     for (long i = 0; i < selectedLines.length(); i++) {
       JSONObject selectedLine = selectedLines.getJSONObject((int) i);
diff -r 6d9538a0098a -r 9ccfd2754c6a 
src/org/openbravo/common/actionhandler/RMShipmentPickEditLines.java
--- a/src/org/openbravo/common/actionhandler/RMShipmentPickEditLines.java       
Tue Jul 24 17:42:36 2012 +0200
+++ b/src/org/openbravo/common/actionhandler/RMShipmentPickEditLines.java       
Tue Jul 24 18:47:18 2012 +0200
@@ -52,7 +52,11 @@
     try {
       jsonRequest = new JSONObject(content);
       log.debug(jsonRequest);
-      final String strInOutId = jsonRequest.getString("inpmInoutId");
+      // When the focus is NOT in the tab of the button (i.e. any child tab) 
and the tab does not
+      // contain any record, the inpmInoutId parameter contains "null" string. 
Use M_InOut_ID
+      // instead because it always contains the id of the selected goods.
+      // Issue 20585: https://issues.openbravo.com/view.php?id=20585
+      final String strInOutId = jsonRequest.getString("M_InOut_ID");
       ShipmentInOut inOut = OBDal.getInstance().get(ShipmentInOut.class, 
strInOutId);
       if (cleanInOutLines(inOut)) {
         createInOutLines(jsonRequest);
@@ -93,7 +97,7 @@
     if (selectedLines.length() == 0) {
       return;
     }
-    final String strInOutId = jsonRequest.getString("inpmInoutId");
+    final String strInOutId = jsonRequest.getString("M_InOut_ID");
     ShipmentInOut inOut = OBDal.getInstance().get(ShipmentInOut.class, 
strInOutId);
     TreeSet<String> rmVendorRefs = new TreeSet<String>();
     for (long i = 0; i < selectedLines.length(); i++) {
diff -r 6d9538a0098a -r 9ccfd2754c6a 
src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
--- a/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java     Tue Jul 
24 17:42:36 2012 +0200
+++ b/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java     Tue Jul 
24 18:47:18 2012 +0200
@@ -65,6 +65,10 @@
     try {
       jsonRequest = new JSONObject(content);
       log.debug(jsonRequest);
+      // When the focus is NOT in the tab of the button (i.e. any child tab) 
and the tab does not
+      // contain any record, the inpcOrderId parameter contains "null" string. 
Use C_Order_ID
+      // instead because it always contains the id of the selected order.
+      // Issue 20585: https://issues.openbravo.com/view.php?id=20585
       final String strOrderId = jsonRequest.getString("C_Order_ID");
       Order order = OBDal.getInstance().get(Order.class, strOrderId);
       if (cleanOrderLines(order)) {

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to