details: https://code.openbravo.com/erp/devel/pi/rev/3d95f9654e98
changeset: 33417:3d95f9654e98
user: Augusto Mauch <augusto.mauch <at> openbravo.com>
date: Fri Feb 09 10:56:05 2018 +0100
summary: Fixes issue 37867: Adds missing admin mode
diffstat:
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java
| 23 ++++++---
1 files changed, 14 insertions(+), 9 deletions(-)
diffs (41 lines):
diff -r 65a8e7ba6ceb -r 3d95f9654e98
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java
---
a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java
Fri Feb 09 10:15:25 2018 +0100
+++
b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java
Fri Feb 09 10:56:05 2018 +0100
@@ -11,7 +11,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) 2014-2016 Openbravo SLU
+ * All portions are Copyright (C) 2014-2018 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -240,15 +240,20 @@
* @return the table whose data is being fetched
*/
private Table getTableFromParameters(Map<String, String> parameters) {
- String tableId = parameters.get("tableId");
- String tabId = parameters.get("tabId");
Table table = null;
- if (tableId != null) {
- table = OBDal.getInstance().get(Table.class, tableId);
- } else if (tabId != null) {
- Tab tab = null;
- tab = OBDal.getInstance().get(Tab.class, tabId);
- table = tab.getTable();
+ try {
+ // OBContext.setAdminMode(true);
+ String tableId = parameters.get("tableId");
+ String tabId = parameters.get("tabId");
+ if (tableId != null) {
+ table = OBDal.getInstance().get(Table.class, tableId);
+ } else if (tabId != null) {
+ Tab tab = null;
+ tab = OBDal.getInstance().get(Tab.class, tabId);
+ table = tab.getTable();
+ }
+ } finally {
+ // OBContext.restorePreviousMode();
}
return table;
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits