bug fixed 0006925: It is not possible to import products on a new client because of a missing default
authorDavid Abragimov <david.abragimov@opensuite.com>
Tue, 20 Jan 2009 15:46:40 +0000
changeset 2664 e59193f0d634
parent 2663 092cca0f2560
child 2665 f5980840d441
bug fixed 0006925: It is not possible to import products on a new client because of a missing default
src-db/database/sourcedata/AD_MESSAGE.xml
src/org/openbravo/erpCommon/ad_process/ImportProduct.java
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Jan 20 12:18:17 2009 +0000
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Jan 20 15:46:40 2009 +0000
@@ -154891,6 +154891,33 @@
 <!--11314163807C4401B2964F93256597EA-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--11314163807C4401B2964F93256597EA**************--></AD_MESSAGE>
 
+<!--1237DD133882495FB6AF87E80A852A66**************--><AD_MESSAGE>
+<!--1237DD133882495FB6AF87E80A852A66 AD_MESSAGE_ID-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <AD_MESSAGE_ID><![CDATA[1237DD133882495FB6AF87E80A852A66]]></AD_MESSAGE_ID>
+<!--1237DD133882495FB6AF87E80A852A66 AD_CLIENT_ID-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1237DD133882495FB6AF87E80A852A66 AD_ORG_ID-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1237DD133882495FB6AF87E80A852A66 ISACTIVE-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1237DD133882495FB6AF87E80A852A66 CREATED-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <CREATED><![CDATA[2009-01-20 16:37:23.0]]></CREATED>
+<!--1237DD133882495FB6AF87E80A852A66 CREATEDBY-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--1237DD133882495FB6AF87E80A852A66 UPDATED-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <UPDATED><![CDATA[2009-01-20 16:48:26.0]]></UPDATED>
+<!--1237DD133882495FB6AF87E80A852A66 UPDATEDBY-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--1237DD133882495FB6AF87E80A852A66 VALUE-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <VALUE><![CDATA[MarkDefaultTaxCategory]]></VALUE>
+<!--1237DD133882495FB6AF87E80A852A66 MSGTEXT-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <MSGTEXT><![CDATA[Before importing product(s) you must set a default tax category]]></MSGTEXT>
+<!--1237DD133882495FB6AF87E80A852A66 MSGTYPE-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--1237DD133882495FB6AF87E80A852A66 AD_MODULE_ID-->
+<!--1237DD133882495FB6AF87E80A852A66-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1237DD133882495FB6AF87E80A852A66**************--></AD_MESSAGE>
+
 <!--1299B933978E465AB8D9E73B85F10A1A**************--><AD_MESSAGE>
 <!--1299B933978E465AB8D9E73B85F10A1A AD_MESSAGE_ID-->
 <!--1299B933978E465AB8D9E73B85F10A1A-->              <AD_MESSAGE_ID><![CDATA[1299B933978E465AB8D9E73B85F10A1A]]></AD_MESSAGE_ID>
--- a/src/org/openbravo/erpCommon/ad_process/ImportProduct.java	Tue Jan 20 12:18:17 2009 +0000
+++ b/src/org/openbravo/erpCommon/ad_process/ImportProduct.java	Tue Jan 20 15:46:40 2009 +0000
@@ -242,6 +242,17 @@
             if (log4j.isDebugEnabled())
                 log4j.debug("ImportProduct C_TaxCategory_ID ="
                         + strcTaxcategoryId);
+            if (strcTaxcategoryId==null || strcTaxcategoryId.equals("")) {
+             // Default Tax category doesn't exist
+                addLog(Utility.messageBD(conn, "MarkDefaultTaxCategory", vars
+                        .getLanguage()));
+                myError.setType("Error");
+                myError.setTitle(Utility.messageBD(conn, "Error", vars
+                        .getLanguage()));
+                myError.setMessage(Utility.messageBD(conn, "MarkDefaultTaxCategory", vars
+                        .getLanguage()));
+                return myError;
+            }
 
             conn.releaseCommitConnection(con);
         } catch (Exception se) {