details:   https://code.openbravo.com/erp/stable/2.50/rev/3e7ae5381605
changeset: 9568:3e7ae5381605
user:      David Alsasua <david.alsasua <at> openbravo.com>
date:      Mon Jul 11 13:15:38 2011 +0200
summary:   Fixes issue 17953.

diffstat:

 src/org/openbravo/erpCommon/businessUtility/COAUtility.java |  26 +++++++------
 1 files changed, 14 insertions(+), 12 deletions(-)

diffs (37 lines):

diff -r b1debdcd65b3 -r 3e7ae5381605 
src/org/openbravo/erpCommon/businessUtility/COAUtility.java
--- a/src/org/openbravo/erpCommon/businessUtility/COAUtility.java       Fri Jul 
01 10:40:01 2011 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/COAUtility.java       Mon Jul 
11 13:15:38 2011 +0200
@@ -414,19 +414,21 @@
     log4j.debug("insertAccountingSchema() - Acct.schema defaults correctly 
iserted.");
 
     log4j.debug("insertAccountingSchema() - Inserting Organization Accounting 
Schema record.");
-    OrganizationAcctSchema orgAcctSchema;
-    try {
-      orgAcctSchema = InitialSetupUtility.insertOrgAcctSchema(client, 
acctSchema, organization);
-    } catch (Exception e) {
-      return logError("@CreateAccountingFailed@",
-          "insertAccountingSchema() - Exception while creating organization - 
acct. schema entry",
-          e);
+    OrganizationAcctSchema orgAcctSchema = null;
+    if (organization != null && organization.getId() != "0") {
+      try {
+        orgAcctSchema = InitialSetupUtility.insertOrgAcctSchema(client, 
acctSchema, organization);
+      } catch (Exception e) {
+        return logError(
+            "@CreateAccountingFailed@",
+            "insertAccountingSchema() - Exception while creating organization 
- acct. schema entry",
+            e);
+      }
+
+      if (orgAcctSchema == null)
+        return logError("@CreateAccountingFailed@",
+            "insertAccountingSchema() - Exception while creating organization 
- acct. schema entry");
     }
-
-    if (orgAcctSchema == null)
-      return logError("@CreateAccountingFailed@",
-          "insertAccountingSchema() - Exception while creating organization - 
acct. schema entry");
-
     return obeResult;
   }
 

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to