Related to issue 19778.Do not use RequestContext on Utility.java.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 02 Feb 2012 13:30:18 +0100
changeset 15650 fc7a5c96f230
parent 15649 3e99736167dc
child 15651 526758bcee23
Related to issue 19778.Do not use RequestContext on Utility.java.
src/org/openbravo/erpCommon/utility/Utility.java
--- a/src/org/openbravo/erpCommon/utility/Utility.java	Wed Feb 01 12:29:11 2012 +0100
+++ b/src/org/openbravo/erpCommon/utility/Utility.java	Thu Feb 02 13:30:18 2012 +0100
@@ -69,7 +69,6 @@
 import org.openbravo.base.secureApp.OrgTree;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.base.session.OBPropertiesProvider;
-import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
@@ -1118,9 +1117,12 @@
    * @return String translated.
    */
   public static String parseTranslation(String text) {
-    final VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
+    // final VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
+    final VariablesSecureApp vars = new VariablesSecureApp(OBContext.getOBContext().getUser()
+        .getId(), OBContext.getOBContext().getCurrentClient().getId(), OBContext.getOBContext()
+        .getCurrentOrganization().getId(), OBContext.getOBContext().getRole().getId());
     final String language = OBContext.getOBContext().getLanguage().getLanguage();
-    return parseTranslation(new DalConnectionProvider(), vars, null, language, text);
+    return parseTranslation(new DalConnectionProvider(false), vars, null, language, text);
   }
 
   /**