details:   https://code.openbravo.com/erp/devel/pi/rev/046abffb4283
changeset: 21239:046abffb4283
user:      Javier Etxarri <javier.echarri <at> openbravo.com>
date:      Mon Oct 07 10:19:00 2013 +0200
summary:   Fixes issue 24890: Cannot delete shipments

diffstat:

 src/org/openbravo/event/MInOutLineEventHandler.java |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (20 lines):

diff -r 4d6b7da16e31 -r 046abffb4283 
src/org/openbravo/event/MInOutLineEventHandler.java
--- a/src/org/openbravo/event/MInOutLineEventHandler.java       Mon Oct 07 
08:50:00 2013 +0200
+++ b/src/org/openbravo/event/MInOutLineEventHandler.java       Mon Oct 07 
10:19:00 2013 +0200
@@ -62,10 +62,11 @@
     if (criteria.count() == 1) {
       ShipmentInOut shipmentInOut = 
OBDal.getInstance().get(ShipmentInOut.class,
           shipmentInOutLine.getShipmentReceipt().getId());
-      shipmentInOut.setSalesOrder(null);
-      OBDal.getInstance().save(shipmentInOut);
-      OBDal.getInstance().flush();
+      if (shipmentInOut != null) {
+        shipmentInOut.setSalesOrder(null);
+        OBDal.getInstance().save(shipmentInOut);
+        OBDal.getInstance().flush();
+      }
     }
   }
-
 }
\ No newline at end of file

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to