details:   https://code.openbravo.com/erp/devel/pi/rev/121adf940b71
changeset: 18161:121adf940b71
user:      Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date:      Mon Oct 08 13:28:38 2012 +0200
summary:   Fixes Issue 0021868: Handling inactive fields in Tab Access.

In the tab access tab, inactive feidls were also taken into consideration. 
Added active filters for the same.

diffstat:

 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java
 |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (20 lines):

diff -r ee9c755796d8 -r 121adf940b71 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java
--- 
a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java
       Mon Oct 08 17:18:34 2012 +0200
+++ 
b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java
       Mon Oct 08 13:28:38 2012 +0200
@@ -230,11 +230,11 @@
           .createQuery(
               Field.class,
               "as f where f.tab.id = :tabId"
-                  + " and (exists (from f.aDFieldAccessList fa where 
fa.tabAccess.windowAccess.role.id = :roleId and fa.editableField = false and 
fa.ischeckonsave = true)"
-                  + "      or (not exists (from f.aDFieldAccessList fa where 
fa.tabAccess.windowAccess.role.id = :roleId)"
-                  + "          and exists (from f.tab.aDTabAccessList ta where 
ta.windowAccess.role.id = :roleId and ta.editableField = false)"
-                  + "          or not exists (from f.tab.aDTabAccessList  ta 
where  ta.windowAccess.role.id = :roleId)"
-                  + "          and exists (from ADWindowAccess wa where 
f.tab.window = wa.window and wa.role.id = :roleId and wa.editableField = 
false)))");
+                  + " and (exists (from f.aDFieldAccessList fa where 
fa.tabAccess.windowAccess.role.id = :roleId and fa.editableField = false and 
fa.active = true and fa.ischeckonsave = true)"
+                  + "      or (not exists (from f.aDFieldAccessList fa where 
fa.tabAccess.windowAccess.role.id = :roleId and and fa.active = true)"
+                  + "          and exists (from f.tab.aDTabAccessList ta where 
ta.windowAccess.role.id = :roleId and ta.editableField = false and ta.active = 
true)"
+                  + "          or not exists (from f.tab.aDTabAccessList  ta 
where  ta.windowAccess.role.id = :roleId and ta.active = true)"
+                  + "          and exists (from ADWindowAccess wa where 
f.tab.window = wa.window and wa.role.id = :roleId and wa.editableField = false 
and wa.active = true)))");
       fieldQuery.setNamedParameter("tabId", tab.getId());
       fieldQuery.setNamedParameter("roleId", roleId);
       final Entity entity = ModelProvider.getInstance().getEntity(entityName);

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to