Fixes Issue 25643 Restrict import COA having account with Search Key, No Name
authorAtul Gaware <atul.gaware@openbravo.com>
Fri, 21 Mar 2014 18:20:16 +0530
changeset 22900 2df9efa7fba0
parent 22899 f30733685b92
child 22901 d1c9b351823b
Fixes Issue 25643 Restrict import COA having account with Search Key, No Name
src/org/openbravo/erpCommon/businessUtility/COAUtility.java
--- a/src/org/openbravo/erpCommon/businessUtility/COAUtility.java	Thu Apr 10 12:29:08 2014 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/COAUtility.java	Fri Mar 21 18:20:16 2014 +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) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2014 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -750,6 +750,10 @@
       } else {
         log4j.debug("insertElementValuesInDB() - Inserting element value in database");
         ElementValue elementValue = null;
+        if ("".equals(data[i].getAccountName()) || data[i].getAccountName() == null) {
+          return logError("@CreateAccountingFailed@" + " Account found without name in COA ",
+              " insertElementValuesInDB() - Account found without name in COA ");
+        }
         try {
           elementValue = InitialSetupUtility.insertElementValue(element, organization,
               data[i].getAccountName(), data[i].getAccountValue(), data[i].getAccountDescription(),