Fixed issue 30047: Finance role should be able to select a account in G/L Report
authorJorge Garcia <jorge.garcia@openbravo.com>
Mon, 01 Jun 2015 13:20:50 +0200
changeset 26850 843ebb54cf07
parent 26849 1bb9cfbc6644
child 26851 9befee29287f
Fixed issue 30047: Finance role should be able to select a account in G/L Report

In an organization structure similar to F&B, a role with access to "US"
organization should be able to filter by specific accounts in General Ledger
Report, although account tree is defined at F&B Organization.

The problem was that the F&B US Finance role cannot select none of the accounts
defined for F&B International group.

The solution is to grant access to the accounts defined for F&B International
group. It has no sense that the user cannot select those accounts, but the user
can see the report with all it's accounts.
src/org/openbravo/erpCommon/info/AccountElementValue.java
--- a/src/org/openbravo/erpCommon/info/AccountElementValue.java	Thu Jun 04 12:53:00 2015 +0200
+++ b/src/org/openbravo/erpCommon/info/AccountElementValue.java	Mon Jun 01 13:20:50 2015 +0200
@@ -306,7 +306,7 @@
           strNumRows = AccountElementValueData.countRows(this, rownum, strAcctSchema, strValue,
               strName, strOrganization, strAccountElementValue,
               Utility.getContext(this, vars, "#User_Client", "AccountElementValue"),
-              Utility.getContext(this, vars, "#User_Org", "AccountElementValue"), pgLimit,
+              Utility.getContext(this, vars, "#AccessibleOrgTree", "AccountElementValue"), pgLimit,
               oraLimit1, oraLimit2);
           vars.setSessionValue("AccountElementValueInfo.numrows", strNumRows);
         } else {
@@ -319,14 +319,14 @@
           data = AccountElementValueData.select(this, "ROWNUM", strAcctSchema, strValue, strName,
               strOrganization, strAccountElementValue,
               Utility.getContext(this, vars, "#User_Client", "AccountElementValue"),
-              Utility.getContext(this, vars, "#User_Org", "AccountElementValue"), strOrderBy,
+              Utility.getContext(this, vars, "#AccessibleOrgTree", "AccountElementValue"), strOrderBy,
               oraLimit, "");
         } else {
           String pgLimit = pageSize + " OFFSET " + offset;
           data = AccountElementValueData.select(this, "1", strAcctSchema, strValue, strName,
               strOrganization, strAccountElementValue,
               Utility.getContext(this, vars, "#User_Client", "AccountElementValue"),
-              Utility.getContext(this, vars, "#User_Org", "AccountElementValue"), strOrderBy, "",
+              Utility.getContext(this, vars, "#AccessibleOrgTree", "AccountElementValue"), strOrderBy, "",
               pgLimit);
         }
       } catch (ServletException e) {