Fixes issue 27918: User Defined Accounting Report Setup shows tree view
authorAugusto Mauch <augusto.mauch@openbravo.com>
Tue, 21 Oct 2014 11:28:25 +0200
changeset 25065 203b797e4189
parent 25064 8e150ca07c2f
child 25066 8a23d66e2f6b
Fixes issue 27918: User Defined Accounting Report Setup shows tree view

The problem was that the tree configuration previous to the new tree implementation was wrong. The Table table had a field called Type Area which was originally used to specify the Tree type of the table. The FinancialMgmtAccountingRptElement table had this field empty, and instead the FinancialMgmtAccountingReport had this field set to Accounting Report, which is the value that should have been assigned to FinancialMgmtAccountingRptElement.

The configuration of the new implementation was done based on the Tree Type field, so it was wrong for the FinancialMgmtAccountingRptElement table. Now it has been properly done (it has been flagged as Is Tree, a record has been added to the Table Tree Category subtab and a value has been selected in the Table Tree Category field of the Tab tab.

Also, a module script has been modified to fix the data of ad_tree. The ad_tree table has a column called ad_table_id, which points to the table that the tree belongs to. The accounting report tree was mistakenly pointing to FinancialMgmtAccountingReport, and the updated modulescript fixes it so that now it points to FinancialMgmtAccountingRptElement.
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/AD_TABLE_TREE.xml
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateADTrees.class
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateADTreesData.class
src-util/modulescript/src/org/openbravo/modulescript/UpdateADTrees.java
src-util/modulescript/src/org/openbravo/modulescript/UpdateADTrees_Data.xsql
--- a/src-db/database/sourcedata/AD_TAB.xml	Mon Oct 20 18:54:45 2014 +0200
+++ b/src-db/database/sourcedata/AD_TAB.xml	Tue Oct 21 11:28:25 2014 +0200
@@ -10974,6 +10974,7 @@
 <!--800212-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--800212-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--800212-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
+<!--800212-->  <AD_TABLE_TREE_ID><![CDATA[9D548EFC27864320A3E8E4C62CD6D28D]]></AD_TABLE_TREE_ID>
 <!--800212-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
 <!--800212-->  <ISREADONLYTREE><![CDATA[N]]></ISREADONLYTREE>
 <!--800212-->  <ISSHOWTREENODEICONS><![CDATA[Y]]></ISSHOWTREENODEICONS>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Mon Oct 20 18:54:45 2014 +0200
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Tue Oct 21 11:28:25 2014 +0200
@@ -7330,8 +7330,9 @@
 <!--800178-->  <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
 <!--800178-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--800178-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1E14B84E040007F01006125]]></AD_PACKAGE_ID>
+<!--800178-->  <TREETYPE><![CDATA[AR]]></TREETYPE>
 <!--800178-->  <DATAORIGINTYPE><![CDATA[Table]]></DATAORIGINTYPE>
-<!--800178-->  <ISTREE><![CDATA[N]]></ISTREE>
+<!--800178-->  <ISTREE><![CDATA[Y]]></ISTREE>
 <!--800178--></AD_TABLE>
 
 <!--800179--><AD_TABLE>
@@ -8295,7 +8296,6 @@
 <!--800223-->  <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
 <!--800223-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--800223-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1E14B84E040007F01006125]]></AD_PACKAGE_ID>
-<!--800223-->  <TREETYPE><![CDATA[AR]]></TREETYPE>
 <!--800223-->  <DATAORIGINTYPE><![CDATA[Table]]></DATAORIGINTYPE>
 <!--800223-->  <ISTREE><![CDATA[Y]]></ISTREE>
 <!--800223--></AD_TABLE>
--- a/src-db/database/sourcedata/AD_TABLE_TREE.xml	Mon Oct 20 18:54:45 2014 +0200
+++ b/src-db/database/sourcedata/AD_TABLE_TREE.xml	Tue Oct 21 11:28:25 2014 +0200
@@ -172,6 +172,25 @@
 <!--9C0304E9DC464C7495AAAC88958E1297-->  <NODEDELETIONPOLICY><![CDATA[RCN]]></NODEDELETIONPOLICY>
 <!--9C0304E9DC464C7495AAAC88958E1297--></AD_TABLE_TREE>
 
+<!--9D548EFC27864320A3E8E4C62CD6D28D--><AD_TABLE_TREE>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <AD_TABLE_TREE_ID><![CDATA[9D548EFC27864320A3E8E4C62CD6D28D]]></AD_TABLE_TREE_ID>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <AD_TABLE_ID><![CDATA[800178]]></AD_TABLE_ID>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <NODEIDCOLUMN><![CDATA[802991]]></NODEIDCOLUMN>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <HASMULTIPARENTNODES><![CDATA[N]]></HASMULTIPARENTNODES>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <APPLYWHERECLAUSETOCHILDNODES><![CDATA[Y]]></APPLYWHERECLAUSETOCHILDNODES>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <NAME><![CDATA[Accounting report]]></NAME>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <ISPARENTSELECTIONALLOWED><![CDATA[Y]]></ISPARENTSELECTIONALLOWED>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <ISORDERED><![CDATA[N]]></ISORDERED>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <TREESTRUCTURE><![CDATA[ADTree]]></TREESTRUCTURE>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <ISHANDLENODESMANUALLY><![CDATA[Y]]></ISHANDLENODESMANUALLY>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <ISMAINTREE><![CDATA[Y]]></ISMAINTREE>
+<!--9D548EFC27864320A3E8E4C62CD6D28D-->  <NODEDELETIONPOLICY><![CDATA[RCN]]></NODEDELETIONPOLICY>
+<!--9D548EFC27864320A3E8E4C62CD6D28D--></AD_TABLE_TREE>
+
 <!--9F30DDEA05FC45C9B7CDA2A128ADE374--><AD_TABLE_TREE>
 <!--9F30DDEA05FC45C9B7CDA2A128ADE374-->  <AD_TABLE_TREE_ID><![CDATA[9F30DDEA05FC45C9B7CDA2A128ADE374]]></AD_TABLE_TREE_ID>
 <!--9F30DDEA05FC45C9B7CDA2A128ADE374-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateADTrees.class has changed
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateADTreesData.class has changed
--- a/src-util/modulescript/src/org/openbravo/modulescript/UpdateADTrees.java	Mon Oct 20 18:54:45 2014 +0200
+++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdateADTrees.java	Tue Oct 21 11:28:25 2014 +0200
@@ -35,6 +35,8 @@
       ConnectionProvider cp = getConnectionProvider();
       // Fills in the ad_table_id column of the existing ad_tree table, using the treetype property to patch each ad_tree with its corresponding ad_table
       UpdateADTreesData.update(cp);
+      // See issue https://issues.openbravo.com/view.php?id=27918
+      UpdateADTreesData.fixAccountingReportSetup(cp);
     } catch (Exception e) {
       handleError(e);
     }
--- a/src-util/modulescript/src/org/openbravo/modulescript/UpdateADTrees_Data.xsql	Mon Oct 20 18:54:45 2014 +0200
+++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdateADTrees_Data.xsql	Tue Oct 21 11:28:25 2014 +0200
@@ -35,4 +35,12 @@
       ]]>
     </Sql>
   </SqlMethod>
+  <SqlMethod name="fixAccountingReportSetup" type="preparedStatement" return="rowcount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        update ad_tree set ad_table_id = '800178' where treetype = 'AR' and ad_table_id = '800223'
+      ]]>
+    </Sql>
+  </SqlMethod>  
 </SqlClass>
\ No newline at end of file