Related to issue 31835: code review improvements
authorVíctor Martínez Romanos <victor.martinez@openbravo.com>
Wed, 13 Jan 2016 15:31:26 +0100
changeset 28251 8d9510cd867e
parent 28250 e3220d26e44f
child 28252 1799d7a3ea4a
Related to issue 31835: code review improvements

The old messages have been reverted because it could be used by external modules, so it could be considered as a functional API Change.
Create a new message instead and improve it to be more descriptive.

Modified pl/sql comment to reflect the new behavior and to avoid confusions in the future
src-db/database/model/triggers/M_PRODUCT_TRG.xml
src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/model/triggers/M_PRODUCT_TRG.xml	Mon Jan 11 17:23:56 2016 +0100
+++ b/src-db/database/model/triggers/M_PRODUCT_TRG.xml	Wed Jan 13 15:31:26 2016 +0100
@@ -62,8 +62,8 @@
   UPDATE M_PRODUCT_ACCT SET AD_ORG_ID = :new.AD_ORG_ID
   WHERE M_PRODUCT_ID = :new.M_PRODUCT_ID;
 
- -- Do not allow to set the product as stocked if it appears in
- -- processed documents which generate inventory transactions
+ -- Do not allow to change the product stocked flag if it appears in
+ -- any core's document (processed or not)
   IF (:old.isStocked <> :new.isStocked) THEN
     SELECT count(*) 
     INTO v_Count
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Jan 11 17:23:56 2016 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Jan 13 15:31:26 2016 +0100
@@ -21951,6 +21951,18 @@
 <!--88A1D0A0F67F49339B2639EA4E5F6B4B-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--88A1D0A0F67F49339B2639EA4E5F6B4B--></AD_MESSAGE>
 
+<!--88E5D345A1684656A952C0A379D5351E--><AD_MESSAGE>
+<!--88E5D345A1684656A952C0A379D5351E-->  <AD_MESSAGE_ID><![CDATA[88E5D345A1684656A952C0A379D5351E]]></AD_MESSAGE_ID>
+<!--88E5D345A1684656A952C0A379D5351E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--88E5D345A1684656A952C0A379D5351E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--88E5D345A1684656A952C0A379D5351E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--88E5D345A1684656A952C0A379D5351E-->  <VALUE><![CDATA[StockedProductWithMovements]]></VALUE>
+<!--88E5D345A1684656A952C0A379D5351E-->  <MSGTEXT><![CDATA[You cannot change the product to non stocked because it has inventory]]></MSGTEXT>
+<!--88E5D345A1684656A952C0A379D5351E-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--88E5D345A1684656A952C0A379D5351E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--88E5D345A1684656A952C0A379D5351E-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--88E5D345A1684656A952C0A379D5351E--></AD_MESSAGE>
+
 <!--8927B08F10B745E9883A329F1FCBC63A--><AD_MESSAGE>
 <!--8927B08F10B745E9883A329F1FCBC63A-->  <AD_MESSAGE_ID><![CDATA[8927B08F10B745E9883A329F1FCBC63A]]></AD_MESSAGE_ID>
 <!--8927B08F10B745E9883A329F1FCBC63A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -24064,6 +24076,18 @@
 <!--B6CDB7D04FD249579A48D26C0ED48F45-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--B6CDB7D04FD249579A48D26C0ED48F45--></AD_MESSAGE>
 
+<!--B6FF3853FDD949709EA0742E2443F1C3--><AD_MESSAGE>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <AD_MESSAGE_ID><![CDATA[B6FF3853FDD949709EA0742E2443F1C3]]></AD_MESSAGE_ID>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <VALUE><![CDATA[StockedFlagWithDocuments]]></VALUE>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <MSGTEXT><![CDATA[You cannot change the Stocked flag because the product has been linked to transactional documents. See Linked Items for details.]]></MSGTEXT>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B6FF3853FDD949709EA0742E2443F1C3-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--B6FF3853FDD949709EA0742E2443F1C3--></AD_MESSAGE>
+
 <!--B72BC899534F4943B0A158FA4E5A5936--><AD_MESSAGE>
 <!--B72BC899534F4943B0A158FA4E5A5936-->  <AD_MESSAGE_ID><![CDATA[B72BC899534F4943B0A158FA4E5A5936]]></AD_MESSAGE_ID>
 <!--B72BC899534F4943B0A158FA4E5A5936-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -25069,8 +25093,8 @@
 <!--CE436C734491444CAAF5FFEE073AE2E1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--CE436C734491444CAAF5FFEE073AE2E1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--CE436C734491444CAAF5FFEE073AE2E1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--CE436C734491444CAAF5FFEE073AE2E1-->  <VALUE><![CDATA[StockedFlagWithDocuments]]></VALUE>
-<!--CE436C734491444CAAF5FFEE073AE2E1-->  <MSGTEXT><![CDATA[You cannot change the product stocked flag because it has related documents]]></MSGTEXT>
+<!--CE436C734491444CAAF5FFEE073AE2E1-->  <VALUE><![CDATA[NonStockedProductWithTransactions]]></VALUE>
+<!--CE436C734491444CAAF5FFEE073AE2E1-->  <MSGTEXT><![CDATA[You cannot change the product to stocked because it has completed documents which would generate inventory transactions]]></MSGTEXT>
 <!--CE436C734491444CAAF5FFEE073AE2E1-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
 <!--CE436C734491444CAAF5FFEE073AE2E1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--CE436C734491444CAAF5FFEE073AE2E1-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>