Fixes Issue 28841:NullPointerException error when posting a work effort
authorAtul Gaware <atul.gaware@openbravo.com>
Tue, 03 Feb 2015 15:57:48 +0530
changeset 24127 e53a7d3c1a4e
parent 24126 80ea36768a2b
child 24128 628cb1400c02
Fixes Issue 28841:NullPointerException error when posting a work effort

Work effort lines with products having setting stocked=No does not
have records in m_ transaction. They should be skipped.
src/org/openbravo/erpCommon/ad_forms/DocProduction.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocProduction.java	Tue Feb 03 12:56:57 2015 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/DocProduction.java	Tue Feb 03 15:57:48 2015 +0530
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2008-2014 Openbravo SLU
+ * All portions are Copyright (C) 2008-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -169,7 +169,7 @@
     int countProductionlinesWithTrnCostZero = 0;
     for (int i = 0; i < p_lines.length; i++) {
       DocLine_Material line = (DocLine_Material) p_lines[i];
-      if (line.transaction.getTransactionCost() != null
+      if (line.transaction != null && line.transaction.getTransactionCost() != null
           && line.transaction.getTransactionCost().compareTo(ZERO) == 0) {
         countProductionlinesWithTrnCostZero++;
       }