Fixed issue 30112: The message shown trying to save a datapackage isn't correct
authorNaroa Iriarte <naroa.iriarte@openbravo.com>
Mon, 08 Jun 2015 12:58:32 +0200
changeset 26877 3ee5b64b9eab
parent 26876 727c9b6c55c2
child 26878 eea55936e896
Fixed issue 30112: The message shown trying to save a datapackage isn't correct

The problem was that the message associated to the label "20102" was not correct in this case.
To fix this, a new message has been added to AD_MESSAGE, and now, the message
'The java package of the Data Package must be within the java package of its module.' is
shown when the java package of the module is not contained in the java package of the data
package.
Also, the duplicated where clause has been removed from the trigger.

This fix has been tested with postgres and also with oracle.
src-db/database/model/triggers/AD_PACKAGE_JP_TRG.xml
src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/model/triggers/AD_PACKAGE_JP_TRG.xml	Mon Jun 08 09:06:35 2015 +0000
+++ b/src-db/database/model/triggers/AD_PACKAGE_JP_TRG.xml	Mon Jun 08 12:58:32 2015 +0200
@@ -15,7 +15,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) 2009-2012 Openbravo SLU
+* All portions are Copyright (C) 2009-2015 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -40,11 +40,10 @@
       INTO v_Aux
     FROM AD_MODULE M
    WHERE M.AD_MODULE_ID = :new.AD_MODULE_ID
-      AND instr(upper(:new.javapackage), upper(M.javapackage)) = 1
       AND instr(upper(:new.javapackage), upper(M.javapackage)) = 1;
 
      IF v_Aux = 0 THEN
-       RAISE_APPLICATION_ERROR(-20000, '@20102@') ;
+       RAISE_APPLICATION_ERROR(-20000, '@DataPackageError@') ;
      END IF;
   END AD_PACKAGE_JP_TRG
 ]]></body>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Jun 08 09:06:35 2015 +0000
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Jun 08 12:58:32 2015 +0200
@@ -21723,6 +21723,18 @@
 <!--8CDA867E7A094FB6A6154FC37865BCE8-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--8CDA867E7A094FB6A6154FC37865BCE8--></AD_MESSAGE>
 
+<!--8CDB54F9158D413D831AC5E9D65FCCF4--><AD_MESSAGE>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <AD_MESSAGE_ID><![CDATA[8CDB54F9158D413D831AC5E9D65FCCF4]]></AD_MESSAGE_ID>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <VALUE><![CDATA[DataPackageError]]></VALUE>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <MSGTEXT><![CDATA[The java package of the Data Package must be within the java package of its module.]]></MSGTEXT>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--8CDB54F9158D413D831AC5E9D65FCCF4--></AD_MESSAGE>
+
 <!--8D490FAC95814DD2BC9C061E9FAC4568--><AD_MESSAGE>
 <!--8D490FAC95814DD2BC9C061E9FAC4568-->  <AD_MESSAGE_ID><![CDATA[8D490FAC95814DD2BC9C061E9FAC4568]]></AD_MESSAGE_ID>
 <!--8D490FAC95814DD2BC9C061E9FAC4568-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>