Fixed issue 15024.Usage audit is stored on System client and * Organization.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Wed, 27 Oct 2010 11:52:55 +0200
changeset 8779 13c29a90462c
parent 8778 8e09349492a6
child 8780 4845dd2480d5
Fixed issue 15024.Usage audit is stored on System client and * Organization.
src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
--- a/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java	Tue Oct 26 19:40:23 2010 +0200
+++ b/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java	Wed Oct 27 11:52:55 2010 +0200
@@ -71,6 +71,7 @@
 import org.openbravo.erpCommon.utility.PrintJRData;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.access.SessionUsageAudit;
+import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.ad.system.SystemInformation;
 import org.openbravo.model.ad.ui.Form;
 import org.openbravo.model.ad.ui.FormTrl;
@@ -78,6 +79,7 @@
 import org.openbravo.model.ad.ui.ProcessTrl;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.WindowTrl;
+import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.utils.FileUtility;
 import org.openbravo.utils.Replace;
 import org.openbravo.xmlEngine.XmlDocument;
@@ -395,6 +397,8 @@
               && !"".equals(vars1.getSessionValue("#AD_Session_ID"))) {
             // Session Usage Audit
             SessionUsageAudit usageAudit = OBProvider.getInstance().get(SessionUsageAudit.class);
+            usageAudit.setClient(OBDal.getInstance().get(Client.class, "0"));
+            usageAudit.setOrganization(OBDal.getInstance().get(Organization.class, "0"));
             usageAudit.setJavaClassName(this.getClass().getName());
             usageAudit.setModule(OBDal.getInstance().get(
                 org.openbravo.model.ad.module.Module.class, SessionInfo.getModuleId()));