Fixed issue
29602: tab to check shouldn't be obtained from table's window
The problem was that tab to check shouldn't be obtained from table's window
but directly from the current window. Now it is taking into account.
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java Mon Jun 01 13:08:42 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java Mon Jun 01 13:16:02 2015 +0200
@@ -79,19 +79,17 @@
final String roleId = OBContext.getOBContext().getRole().getId();
final DalConnectionProvider dalConnectionProvider = new DalConnectionProvider();
final JSONObject jsonUIPattern = new JSONObject();
+ final String windowType = window.getWindowType();
for (Tab tab : window.getADTabList()) {
final boolean readOnlyAccess = org.openbravo.erpCommon.utility.WindowAccessData
.hasReadOnlyAccess(dalConnectionProvider, roleId, tab.getId());
String uiPattern = readOnlyAccess ? "RO" : tab.getUIPattern();
// window should be read only when is assigned with a table defined as a view
- if (tab.getTable().getWindow() != null) {
- String windowType = tab.getTable().getWindow().getWindowType();
- if (!"RO".equals(uiPattern) && tab.getTable().isView()
- && ("T".equals(windowType) || "M".equals(windowType))) {
- log4j.warn("Tab \"" + tab.getName()
- + "\" is set to read only because is assigned with a table defined as a view.");
- uiPattern = "RO";
- }
+ if (!"RO".equals(uiPattern)
+ && ("T".equals(windowType) || "M".equals(windowType) && tab.getTable().isView())) {
+ log4j.warn("Tab \"" + tab.getName()
+ + "\" is set to read only because is assigned with a table defined as a view.");
+ uiPattern = "RO";
}
jsonUIPattern.put(tab.getId(), uiPattern);
}