details:   /erp/devel/pi/rev/aed2a68566d2
changeset: 11801:aed2a68566d2
user:      Ainhoa Pagola <ainhoa.pagola <at> openbravo.com>
date:      Thu Apr 28 18:45:04 2011 +0200
summary:   Fixes issue 16719. Element values can't be deleted if they have 
pending children

details:   /erp/devel/pi/rev/88493d62e8b9
changeset: 11802:88493d62e8b9
user:      Ainhoa Pagola <ainhoa.pagola <at> openbravo.com>
date:      Thu Apr 28 19:50:03 2011 +0200
summary:   Fixes issue 15996 Dimension field set to mandatory in Dimensional 
Reports

diffstat:

 src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml                          
              |  18 ++++++++-
 src-db/database/sourcedata/AD_MESSAGE.xml                                      
              |  11 ++++++
 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html
 |   2 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.html
   |   2 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesFilterJR.html
        |   2 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesFilterJR.html
        |   2 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesFilter.html
       |   2 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJRFilter.html
            |   2 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html
         |   2 +-
 9 files changed, 34 insertions(+), 9 deletions(-)

diffs (151 lines):

diff -r 26361fd2e787 -r 88493d62e8b9 
src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml
--- a/src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml     Thu Apr 28 
18:09:50 2011 +0200
+++ b/src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml     Thu Apr 28 
19:50:03 2011 +0200
@@ -14,7 +14,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) 2001-2008 Openbravo SLU
+* All portions are Copyright (C) 2001-2011 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -25,7 +25,7 @@
   v_xTree_ID VARCHAR2(32);
   v_xParent_ID VARCHAR2(32);
   v_NextNo     VARCHAR2(32);
-  v_Cont NUMBER;
+  v_count NUMBER;
     
 BEGIN
     
@@ -113,12 +113,26 @@
   END IF;
   -- Updating
   IF DELETING THEN
+
+
     --  Delete TreeNode --
     --  get AD_Tree_ID
     SELECT e.AD_Tree_ID
     INTO v_xTree_ID
     FROM C_Element e
     WHERE e.C_Element_ID=:old.C_Element_ID;
+
+    SELECT COUNT(*)
+    INTO v_count
+    FROM AD_TREENODE
+    WHERE AD_CLIENT_ID=:old.AD_Client_ID
+      AND AD_Tree_ID=v_xTree_ID
+      AND parent_ID=:old.C_ElementValue_ID;
+
+    IF (v_count>0) THEN
+      RAISE_APPLICATION_ERROR(-20000, '@ElementHasChildren@');
+    END IF;
+
     DELETE
     FROM AD_TREENODE
     WHERE AD_CLIENT_ID=:old.AD_Client_ID
diff -r 26361fd2e787 -r 88493d62e8b9 src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Thu Apr 28 18:09:50 2011 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Thu Apr 28 19:50:03 2011 +0200
@@ -34644,4 +34644,15 @@
 <!--FF8081812EDCCB27012EDCD3F897000A-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF8081812EDCCB27012EDCD3F897000A--></AD_MESSAGE>
 
+<!--FF8081812F9C927B012F9CA0BF39000D--><AD_MESSAGE>
+<!--FF8081812F9C927B012F9CA0BF39000D-->  
<AD_MESSAGE_ID><![CDATA[FF8081812F9C927B012F9CA0BF39000D]]></AD_MESSAGE_ID>
+<!--FF8081812F9C927B012F9CA0BF39000D-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8081812F9C927B012F9CA0BF39000D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8081812F9C927B012F9CA0BF39000D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8081812F9C927B012F9CA0BF39000D-->  
<VALUE><![CDATA[ElementHasChildren]]></VALUE>
+<!--FF8081812F9C927B012F9CA0BF39000D-->  <MSGTEXT><![CDATA[This record cannot 
be deleted because it's the parent element of other element values. Please 
delete or move them to another element value before deleting.]]></MSGTEXT>
+<!--FF8081812F9C927B012F9CA0BF39000D-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--FF8081812F9C927B012F9CA0BF39000D-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FF8081812F9C927B012F9CA0BF39000D--></AD_MESSAGE>
+
 </data>
diff -r 26361fd2e787 -r 88493d62e8b9 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html
      Thu Apr 28 18:09:50 2011 +0200
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html
      Thu Apr 28 19:50:03 2011 +0200
@@ -709,7 +709,7 @@
                       <table border="0" cellspacing="0" cellpadding="0">
                         <tr>
                         <td>
-                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height">
+                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height required">
                               <option id="paramShown" value="1">Prueba</option>
                             </select>
                           </td>
diff -r 26361fd2e787 -r 88493d62e8b9 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.html
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.html
        Thu Apr 28 18:09:50 2011 +0200
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.html
        Thu Apr 28 19:50:03 2011 +0200
@@ -664,7 +664,7 @@
                       <table border="0" cellspacing="0" cellpadding="0">
                         <tr>
                         <td>
-                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height">
+                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height required">
                               <option id="paramShown" value="1">Test</option>
                             </select>
                           </td>
diff -r 26361fd2e787 -r 88493d62e8b9 
src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesFilterJR.html
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesFilterJR.html
     Thu Apr 28 18:09:50 2011 +0200
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesFilterJR.html
     Thu Apr 28 19:50:03 2011 +0200
@@ -657,7 +657,7 @@
                       <table border="0" cellspacing="0" cellpadding="0">
                         <tr>
                         <td>
-                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height">
+                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height required">
                               <option id="paramShown" value="1">Test</option>
                             </select>
                           </td>
diff -r 26361fd2e787 -r 88493d62e8b9 
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesFilterJR.html
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesFilterJR.html
     Thu Apr 28 18:09:50 2011 +0200
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesFilterJR.html
     Thu Apr 28 19:50:03 2011 +0200
@@ -671,7 +671,7 @@
                     <table border="0" cellspacing="0" cellpadding="0">
                       <tr>
                         <td>
-                          <select name="inpShown" multiple="" id="reportShown" 
class="Dimension_RightSelect_width Dimension_RightSelect_height">
+                          <select name="inpShown" multiple="" id="reportShown" 
class="Dimension_RightSelect_width Dimension_RightSelect_height required">
                             <option id="paramShown" value="1">Test</option>
                           </select>
                         </td>
diff -r 26361fd2e787 -r 88493d62e8b9 
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesFilter.html
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesFilter.html
    Thu Apr 28 18:09:50 2011 +0200
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesFilter.html
    Thu Apr 28 19:50:03 2011 +0200
@@ -686,7 +686,7 @@
                       <table border="0" cellspacing="0" cellpadding="0">
                         <tr>
                         <td>
-                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height">
+                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height required">
                               <option id="paramShown" value="1">Test</option>
                             </select>
                           </td>
diff -r 26361fd2e787 -r 88493d62e8b9 
src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJRFilter.html
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJRFilter.html
 Thu Apr 28 18:09:50 2011 +0200
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJRFilter.html
 Thu Apr 28 19:50:03 2011 +0200
@@ -678,7 +678,7 @@
                       <table border="0" cellspacing="0" cellpadding="0">
                         <tr>
                         <td>
-                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height">
+                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height required">
                               <option id="paramShown" value="1">Test</option>
                             </select>
                           </td>
diff -r 26361fd2e787 -r 88493d62e8b9 
src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html
      Thu Apr 28 18:09:50 2011 +0200
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html
      Thu Apr 28 19:50:03 2011 +0200
@@ -677,7 +677,7 @@
                       <table border="0" cellspacing="0" cellpadding="0">
                         <tr>
                           <td rowspan="3">
-                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height">
+                            <select name="inpShown" multiple="" 
id="reportShown" class="Dimension_RightSelect_width 
Dimension_RightSelect_height required">
                               <option id="paramShown" value="1">Test</option>
                             </select>
                           </td>

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to