Merge back from main
authorRM packaging bot <staff.rm@openbravo.com>
Tue, 11 Dec 2018 12:26:44 +0000
changeset 35215 4c4039a9c917
parent 35214 05948dd8851c (diff)
parent 34890 e86213540c78 (current diff)
child 35216 ebd6611474d3
Merge back from main
legal/Licensing.txt
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
src-db/database/model/prescript-PostgreSql.sql
src-db/database/sourcedata/AD_MODULE.xml
src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
src/org/openbravo/dal/core/OBContext.java
src/org/openbravo/dal/service/OBDal.java
src/org/openbravo/email/EmailEventManager.java
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product.java
--- a/.hgignore	Tue Dec 11 12:11:50 2018 +0000
+++ b/.hgignore	Tue Dec 11 12:26:44 2018 +0000
@@ -26,7 +26,10 @@
 config/instance.revision
 config/eclipse/hibernate.cfg.xml
 src/result.xml
+config/log4j2.xml
+config/log4j2-web.xml
 
+src-test/src/log4j2-test.xml
 src-db/database/lib/dbmanager.jar
 src-db/database/formalChangesScript.xml
 src-core/lib/openbravo-core.jar
--- a/build.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/build.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -234,6 +234,7 @@
     <fileset dir="${build.wad.lib}">
       <include name="openbravo-wad.jar" />
     </fileset>
+    <pathelement path="${base.config}" />
   </path>
 
   <path id="project.class.path">
@@ -241,9 +242,14 @@
       <include name="*/build/classes/" />
     </dirset>
     <pathelement path="${basedir}/src-util/modulescript/build/classes/" />
+    <pathelement path="${base.config}" />
     <pathelement path="${build}" />
     <pathelement path="${base.src}" />
+    <fileset dir="${base.lib}/build">
+      <include name="*.jar" />
+    </fileset>
     <fileset dir="${base.lib}">
+      <exclude name="build/*" />
       <include name="**/*.jar" />
     </fileset>
     <fileset dir="${build.core.lib}">
@@ -275,6 +281,7 @@
     </dirset>
     <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" />
     <pathelement path="${build.apply.module}" />
+    <pathelement path="${base.config}" />
     <pathelement path="${base.src}" />
     <fileset dir="${base.lib}">
       <include name="**/*.jar" />
@@ -305,6 +312,7 @@
       <include name="*/build/classes/" />
     </dirset>
     <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" />
+    <pathelement path="${base.config}" />
     <pathelement path="${build.apply.module}" />
     <pathelement path="${build}" />
     <pathelement path="${base.src}" />
@@ -426,11 +434,6 @@
     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
     <antcall target="build.deploy" />
     <updatesystemstatuswhennot v="RB51" previous="RB12"/>
-    <!-- only restart tomcat if the restart prop was set to true -->
-    <condition property="dorestart">
-      <istrue value="${restart}" />
-    </condition>
-    <antcall target="if.restart.tomcat" />
   </target>
 
   <target name="update.database.if.no.local" if="no.local">
@@ -459,10 +462,6 @@
     <antcall target="war" />
   </target>
 
-  <target name="if.restart.tomcat" if="dorestart">
-    <antcall target="tomcat.restart" />
-  </target>
-
   <target name="compile" depends="init,core.lib, wad.lib, trl.lib">
     <ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true" />
   </target>
@@ -615,7 +614,6 @@
                   password="${bbdd.password}" 
                   stableDBdir="${stableDBdir}"
                   testDBdir="${basedir}"
-                  verbosity="${bbdd.verbosity}"
                   modules="${modules}"
     />    
   </target>
@@ -807,7 +805,7 @@
 		This task is called from the Openbravo ui, it spawns a java call which again
 		calls the restart.tomcat.do task as a spawned task.
 	-->
-  <target name="tomcat.restart" description="Restart the tomcat server process">
+  <target name="tomcat.restart">
     <echo message="Restarting tomcat..." />
     <java classname="org.openbravo.service.system.RestartTomcat" spawn="true" fork="true" maxmemory="${build.maxmemory}">
       <arg line="${base.src}" />
@@ -818,7 +816,7 @@
   <!--
 		Is called by the org.openbravo.service.system.RestartTomcat class.
 	-->
-  <target name="tomcat.restart.do" description="Restart the tomcat server process">
+  <target name="tomcat.restart.do">
     <echo message="Restarting Tomcat at ${env.CATALINA_HOME}" />
     <java classname="org.apache.catalina.startup.Bootstrap" fork="true">
       <classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar:${env.CATALINA_HOME}/bin/tomcat-juli.jar" />
@@ -844,25 +842,6 @@
     </java>
   </target>
 
-  <!-- 
-		This task is called from the Openbravo ui, it spawns a java call which again
-		calls the tomcat.reload.do task as a spawned task.
-	-->
-  <target name="tomcat.reload" description="Reload the Openbravo context">
-    <echo message="Reloading webapp..." />
-    <java classname="org.openbravo.service.system.ReloadContext" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}" spawn="true" fork="true">
-      <arg line="${base.src}" />
-      <classpath refid="project.class.path" />
-    </java>
-  </target>
-
-  <target name="tomcat.reload.do">
-    <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
-      <classpath refid="project.class.path" />
-    </taskdef>
-    <reload url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" />
-  </target>
-
   <target name="tomcat.list">
     <taskdef name="list" classname="org.apache.catalina.ant.ListTask">
       <classpath refid="project.class.path" />
@@ -950,7 +929,7 @@
     <taskdef name="configurationApp" classname="org.openbravo.configuration.ConfigurationApp">
       <classpath refid="project.class.path" />
     </taskdef>
-    <configurationApp/>
+    <configurationApp nonInteractive="${nonInteractive}" acceptLicense="${acceptLicense}"/>
     </target>
   
   <target name="package.core" depends="init, set.version.number">
@@ -1022,7 +1001,9 @@
       <arg line="'${base.config}/Openbravo.properties' ${logFileName}" />
       <classpath>
         <pathelement path="${build.core.lib}/openbravo-core.jar" />
-        <pathelement path="${base.lib}/runtime/log4j-1.2.16.jar" />
+        <pathelement path="${base.lib}/runtime/log4j-1.2-api-2.11.1.jar" />
+        <pathelement path="${base.lib}/runtime/log4j-api-2.11.1.jar" />
+        <pathelement path="${base.lib}/runtime/log4j-core-2.11.1.jar" />
         <pathelement path="${base.lib}/runtime/commons-pool-1.5.6.jar" />
         <pathelement path="${base.lib}/runtime/commons-dbcp-1.4.jar" />
         <pathelement path="${base.lib}/runtime/postgresql-42.2.2.jre7.jar" />
--- a/config/Openbravo.properties.template	Tue Dec 11 12:11:50 2018 +0000
+++ b/config/Openbravo.properties.template	Tue Dec 11 12:26:44 2018 +0000
@@ -119,7 +119,6 @@
 ##########################
 
 bbdd.outputscript=databasescript.sql
-bbdd.verbosity=INFO
 
 # use js/css minimization (in local-context and war-file)
 minimizeJSandCSS=yes
--- a/config/log4j.lcf.template	Tue Dec 11 12:11:50 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-# *************************************************************************
-# * The contents of this file are subject to the Openbravo  Public  License
-# * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
-# * Version 1.1  with a permitted attribution clause; you may not  use this
-# * file except in compliance with the License. You  may  obtain  a copy of
-# * the License at http://www.openbravo.com/legal/license.html 
-# * Software distributed under the License  is  distributed  on  an "AS IS"
-# * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# * License for the specific  language  governing  rights  and  limitations
-# * under the License. 
-# * The Original Code is Openbravo ERP. 
-# * The Initial Developer of the Original Code is Openbravo SLU
-# * All portions are Copyright (C) 2007-2013 Openbravo SLU
-# * All Rights Reserved. 
-# * Contributor(s):  ______________________________________.
-# ************************************************************************
-
-# to enable logging in i.e. eclipse console add ", C" to the line below
-log4j.rootCategory=INFO, R
-
-# Set our global levels
-log4j.category.org=WARN
-log4j.category.org.openbravo=INFO
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.File=${catalina.base}/logs/openbravo.log
-log4j.appender.R.MaxFileSize=10000KB
-
-# R uses PatternLayout.
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c - %m%n
-
-# Keep one backup file
-log4j.appender.R.MaxBackupIndex=1
-
-# C is an optional ConsoleAppender for usage in i.e. Eclipse
-log4j.appender.C=org.apache.log4j.ConsoleAppender
-log4j.appender.C.layout=org.apache.log4j.PatternLayout
-log4j.appender.C.layout.ConversionPattern=%-4r [%t] %-5p %c - %m%n
-
-log4j.category.reloadXml=ERROR
-
-# To debug an specific class
-#log4j.category.org.openbravo.erpCommon.ad_process=DEBUG
-
-#****************************************************
-# Hibernate
-#****************************************************
-log4j.appender.HB=org.apache.log4j.RollingFileAppender
-log4j.appender.HB.File=${catalina.base}/logs/openbravo_hibernate.log
-log4j.appender.HB.MaxFileSize=10000KB
-
-# R uses PatternLayout.
-log4j.appender.HB.layout=org.apache.log4j.PatternLayout
-log4j.appender.HB.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c - %m%n
-
-# Keep one backup file
-log4j.appender.HB.MaxBackupIndex=1
-
-log4j.logger.org.hibernate=error, HB
-
-### log HQL query parser activity
-#log4j.logger.org.hibernate.hql.ast.AST=error, HB
-
-### log just the SQL
-log4j.logger.org.hibernate.SQL=error, HB
-
-### log JDBC bind parameters ###
-log4j.logger.org.hibernate.type=error, HB
-
-### log schema export/update ###
-log4j.logger.org.hibernate.tool.hbm2ddl=error, HB
-
-### log HQL parse trees
-log4j.logger.org.hibernate.hql=error, HB
-
-### log cache activity ###
-log4j.logger.org.hibernate.cache=error, HB
-
-### log transaction activity
-log4j.logger.org.hibernate.transaction=error, HB
-
-### log JDBC resource acquisition
-log4j.logger.org.hibernate.jdbc=error, HB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/log4j2-web.xml.template	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2018 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<!-- Logger configuration used when running as a web application in a container (e.g. Tomcat) -->
+<!-- Rebuild tasks executed from Module Management Window uses the build config file (log4j2.xml) -->
+<Configuration>
+  <Properties>
+    <Property name="logDir">${env:CATALINA_BASE}/logs</Property>
+  </Properties>
+
+  <Loggers>
+    <Root level="info">
+      <AppenderRef ref="RollingFile"/>
+      <!-- Add this appender to show log messages in console i.e Eclipse: -->
+      <!-- <AppenderRef ref="Console"/> -->
+    </Root>
+
+    <Logger name="reloadXml" level="error"/>
+    <Logger name="org.hibernate" level="error"/>
+
+    <!-- To debug a specific class/package: -->
+    <!-- <Logger name="org.openbravo.erpCommon.ad_process" level="debug"/> -->
+  </Loggers>
+
+  <Appenders>
+    <RollingFile name="RollingFile" fileName="${logDir}/openbravo.log"
+                 filePattern="${logDir}/openbravo-%d{yyyyMMdd}-%i.log.gz">
+      <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+      <Policies>
+        <SizeBasedTriggeringPolicy size="100MB" />
+        <TimeBasedTriggeringPolicy />
+      </Policies>
+      <DefaultRolloverStrategy max="30"/>
+    </RollingFile>
+
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+    </Console>
+  </Appenders>
+</Configuration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/log4j2.xml.template	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2018 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<!-- Logger configuration used in all build tasks -->
+<!-- Note that this config is also used in rebuild tasks executed from the Module Management window in the backoffice -->
+<Configuration packages="org.openbravo.utils">
+  <Loggers>
+    <Root level="info">
+      <AppenderRef ref="Console"/>
+
+      <!-- OBRebuildAppender is required for rebuilding from the GUI -->
+      <AppenderRef ref="OBRebuildAppender"/>
+    </Root>
+
+    <Logger name="org.hibernate" level="error"/>
+
+    <Logger name="reloadXml" level="error"/>
+
+    <!-- To debug a specific class/package: -->
+    <!-- <Logger name="org.openbravo.erpCommon.modules.ApplyModuleTask" level="debug"/> -->
+  </Loggers>
+
+  <Appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%-5r [%t] %-5p %c - %m%n"/>
+    </Console>
+
+    <OBRebuildAppender name="OBRebuildAppender"/>
+  </Appenders>
+</Configuration>
--- a/legal/Licensing.txt	Tue Dec 11 12:11:50 2018 +0000
+++ b/legal/Licensing.txt	Tue Dec 11 12:26:44 2018 +0000
@@ -89,7 +89,6 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: (http://developer.yahoo.net/yui/license.txt)
 
 # ant-1.9.2.jar
-# ant-apache-log4j-1.9.2.jar
 # ant-launcher-1.9.2.jar
 # ant-nodeps.jar
 # avalon-framework-4.1.5.jar
@@ -124,7 +123,11 @@
 # fop-1.1.jar
 # jakarta-oro-2.0.8.jar
 # jettison-1.3-patched.jar
-# log4j-1.2.16.jar
+# log4j-api-2.11.1.jar
+# log4j-core-2.11.1.jar
+# log4j-web-2.11.1.jar
+# log4j-slf4j-impl-2.11.1.jar
+# log4j-1.2-api-2.11.1.jar
 # quartz-1.6.2.jar
 # servlet-api.jar 
 # tika-core-0.9.jar
@@ -195,8 +198,7 @@
 # javassist-3.22.0-GA.jar
 Under MPL License (included as MPL-1.1.txt in this folder)
 
-# slf4j-api-1.6.1.jar
-# slf4j-log4j12-1.6.1.jar
+# slf4j-api-1.7.25.jar
 Under MIT license. (available at http://www.slf4j.org/license.html)
 
 # freemarker-2.3.16.jar
@@ -218,7 +220,7 @@
 Under the LGPL license (included as LGPL-2.1.txt in this folder)
 
 # cal10n-api-0.7.7.jar
-# slf4j-ext-1.6.1.jar
+# slf4j-ext-1.7.25.jar
 Under the MIT license (available at http://www.slf4j.org/license.html)
 
 # cdi-api.jar
@@ -278,7 +280,7 @@
 Under the CDDL license version 1.0 (license available at https://spdx.org/licenses/CDDL-1.0.html 
 or in the file CDDL-1.0.txt in this folder)
 
-# javax.activation-api-1.2.0.jar
+# javax.activation-1.2.0.jar
 # jaxb-api-2.2.12.jar
 # jaxb-impl-2.2.6.jar
 # javax.mail-1.6.1.jar
Binary file lib/build/log4j-api-no-mrjar-2.11.1.jar has changed
Binary file lib/runtime/ant-apache-log4j-1.9.2.jar has changed
Binary file lib/runtime/javax.activation-1.2.0.jar has changed
Binary file lib/runtime/javax.activation-api-1.2.0.jar has changed
Binary file lib/runtime/log4j-1.2-api-2.11.1.jar has changed
Binary file lib/runtime/log4j-1.2.16.jar has changed
Binary file lib/runtime/log4j-api-2.11.1.jar has changed
Binary file lib/runtime/log4j-core-2.11.1.jar has changed
Binary file lib/runtime/log4j-slf4j-impl-2.11.1.jar has changed
Binary file lib/runtime/log4j-web-2.11.1.jar has changed
Binary file lib/runtime/slf4j-api-1.6.1.jar has changed
Binary file lib/runtime/slf4j-api-1.7.25.jar has changed
Binary file lib/runtime/slf4j-log4j12-1.6.1.jar has changed
--- a/log4j.lcf	Tue Dec 11 12:11:50 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-# Set root category priority to DEBUG and its only appender to A1.
-log4j.rootCategory=WARN, A1
-  
-# A1 is set to be a ConsoleAppender. 
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-  
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c - %m%n
-
-log4j.category.org.openbravo.wad=DEBUG
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -83,6 +83,8 @@
 v_PricePr NUMBER;
 v_isinvoicepaid CHAR(1):= 'N';
 v_IsCashVAT C_Invoice.IsCashVAT%TYPE;
+v_prepaymentamt NUMBER;
+v_hasPrepaymentToReturn BOOLEAN := false;
 
 TYPE RECORD IS REF CURSOR;
 Cur_Params RECORD;
@@ -126,13 +128,13 @@
       C_BPartner_ID, DateInvoiced, totallines, fin_paymentmethod_id,
       fin_payment_priority_id, documentNo, poreference,
       c_project_id, c_campaign_id, c_activity_id, user1_id, user2_id, c_costcenter_id,
-      IsCashVAT
+      IsCashVAT, prepaymentamt
   INTO v_Client_ID, v_Org_ID, v_DocTypeTarget_ID, v_IsSOTrx,
       v_GrandTotal, v_PaymentTerm, v_PaymentRule, v_Currency_ID,
       v_BPartner_ID, v_DateInvoiced, v_totallines, v_PaymentMethod,
       v_PaymentPriority, v_documentno, v_poreference,
       v_project_id, v_campaign_id, v_activity_id, v_user1, v_user2, v_costcenter,
-      v_IsCashVAT
+      v_IsCashVAT, v_prepaymentamt
   FROM c_invoice
   WHERE c_invoice_id=p_record_id;
   
@@ -265,11 +267,18 @@
       INTO v_ConsumedGranTotal
       FROM fin_payment_schedule ps
       WHERE ps.c_invoice_id = p_record_id;
+
+      --When the Total Amount of the Invoice is 0 and nothing has been consumed yet for the Invoice
+      --but there is already a prepayment made for a related Order
+      --Related to Issue https://issues.openbravo.com/view.php?id=39415
+      IF (v_GrandTotal = 0 AND v_ConsumedGranTotal = 0 AND v_prepaymentamt <> 0) THEN
+        v_hasPrepaymentToReturn := true;
+      END IF;
             
       --Insert Payment Schedules for Invoices
       v_pendingAmount := v_GrandTotal - coalesce(v_ConsumedGranTotal, 0);
 
-      IF (v_pendingAmount <> 0) THEN
+      IF (v_pendingAmount <> 0 OR v_hasPrepaymentToReturn) THEN
 
         --get number of payment schedules expected for the invoice
         SELECT count(*) INTO v_paymentcount
@@ -1168,8 +1177,6 @@
     END;
 
   ELSIF (p_docaction = 'RC') THEN
-    DECLARE
-      v_prepaymentamt NUMBER;
     BEGIN
       v_delete_paymentplan := TRUE;
       SELECT c_invoice_id INTO v_reversalinvoice_id
--- a/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/TransactionsWithMissingDataData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/TransactionsWithMissingDataData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class TransactionsWithMissingDataData implements FieldProvider {
-static Logger log4j = Logger.getLogger(TransactionsWithMissingDataData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String documentno;
   public String finFinaccTransactionId;
--- a/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/UniquePaymentForTransactionData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/UniquePaymentForTransactionData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UniquePaymentForTransactionData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UniquePaymentForTransactionData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String documentno;
   public String finPaymentId;
--- a/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UnpostRefundPaymentsData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UnpostRefundPaymentsData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String adClientId;
   public String adOrgId;
--- a/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/WrongPaymentScheduleDetailsCheckData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/WrongPaymentScheduleDetailsCheckData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class WrongPaymentScheduleDetailsCheckData implements FieldProvider {
-static Logger log4j = Logger.getLogger(WrongPaymentScheduleDetailsCheckData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String client;
   public String documentno;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfiguration.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfiguration.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.UUID;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -31,7 +32,7 @@
 import org.openbravo.modulescript.OpenbravoVersion;
 
 public class CreateAccountingConfiguration extends ModuleScript {
-  private static final Logger log4j = Logger.getLogger(CreateAccountingConfiguration.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   @Override
   // Inserting:
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/CreateDocumentNoSequence.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/CreateDocumentNoSequence.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.UUID;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/DeleteWrongTransactions.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/DeleteWrongTransactions.java	Tue Dec 11 12:26:44 2018 +0000
@@ -18,7 +18,8 @@
  */
 package org.openbravo.advpaymentmngt.modulescript;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import java.sql.Connection;
 import org.openbravo.utils.FormatUtilities;
 import org.openbravo.database.ConnectionProvider;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/LinkCreditPayments.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/LinkCreditPayments.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,14 +22,15 @@
 
 import javax.servlet.ServletException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.modulescript.ModuleScript;
 import org.openbravo.modulescript.ModuleScriptExecutionLimits;
 import org.openbravo.modulescript.OpenbravoVersion;
 
 public class LinkCreditPayments extends ModuleScript {
-  private static final Logger log4j = Logger.getLogger(LinkCreditPayments.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   @Override
   public void execute() {
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateGeneratedUsedCreditColumns.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateGeneratedUsedCreditColumns.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.UUID;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateReconciliationProcessButtonValue.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateReconciliationProcessButtonValue.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.UUID;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfigurationData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfigurationData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class CreateAccountingConfigurationData implements FieldProvider {
-static Logger log4j = Logger.getLogger(CreateAccountingConfigurationData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String cAcctschemaId;
   public String adClientId;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/CreateDocumentNoSequenceData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/CreateDocumentNoSequenceData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class CreateDocumentNoSequenceData implements FieldProvider {
-static Logger log4j = Logger.getLogger(CreateDocumentNoSequenceData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String tablename;
   public String client;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/DeleteWrongTransactionsData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/DeleteWrongTransactionsData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class DeleteWrongTransactionsData implements FieldProvider {
-static Logger log4j = Logger.getLogger(DeleteWrongTransactionsData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String finPaymentId;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/InitializeAPRMReadyPreferenceData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/InitializeAPRMReadyPreferenceData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class InitializeAPRMReadyPreferenceData implements FieldProvider {
-static Logger log4j = Logger.getLogger(InitializeAPRMReadyPreferenceData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String exist;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class Issue28591UpdatePSDData implements FieldProvider {
-static Logger log4j = Logger.getLogger(Issue28591UpdatePSDData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String finPaymentScheduledetailId;
   public String outstandingamt;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/LinkCreditPaymentsData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/LinkCreditPaymentsData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class LinkCreditPaymentsData implements FieldProvider {
-static Logger log4j = Logger.getLogger(LinkCreditPaymentsData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String finPaymentId;
   public String usedCredit;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdateCustomerBalanceData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdateCustomerBalanceData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String cBpartnerId;
   public String customercredit;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateGeneratedUsedCreditColumnsData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateGeneratedUsedCreditColumnsData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdateGeneratedUsedCreditColumnsData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdateGeneratedUsedCreditColumnsData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String rowCount;
   public String type;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateMatchedDocumentData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateMatchedDocumentData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -12,7 +13,7 @@
 import org.openbravo.data.UtilSql;
 
 class UpdateMatchedDocumentData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdateMatchedDocumentData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String existpreference;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdatePaymentProcessedValueData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdatePaymentProcessedValueData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdatePaymentProcessedValueData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdatePaymentProcessedValueData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String name;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdatePaymentScheduledetailData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdatePaymentScheduledetailData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdatePaymentScheduledetailData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdatePaymentScheduledetailData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String finPaymentScheduledetailId;
   public String outstandingamt;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateReconciliationProcessButtonValueData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateReconciliationProcessButtonValueData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdateReconciliationProcessButtonValueData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdateReconciliationProcessButtonValueData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String name;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateReconciliationStatementProcessedValueData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateReconciliationStatementProcessedValueData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdateReconciliationStatementProcessedValueData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdateReconciliationStatementProcessedValueData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String name;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2ValueData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2ValueData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdateRecordId2ValueData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdateRecordId2ValueData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String name;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionBPExchangeRateData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionBPExchangeRateData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdateTransactionBPExchangeRateData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdateTransactionBPExchangeRateData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String name;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTabData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTabData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class UpdateTransactionTypeTransactionTabData implements FieldProvider {
-static Logger log4j = Logger.getLogger(UpdateTransactionTypeTransactionTabData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String name;
 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/WrongPaymentsFromJournalLineData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/WrongPaymentsFromJournalLineData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -13,7 +14,7 @@
 import java.util.*;
 
 class WrongPaymentsFromJournalLineData implements FieldProvider {
-static Logger log4j = Logger.getLogger(WrongPaymentsFromJournalLineData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String adClientId;
   public String paymentinfo;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/APRMActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/APRMActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -20,7 +20,8 @@
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.client.kernel.BaseActionHandler;
@@ -29,7 +30,7 @@
 import org.openbravo.model.financialmgmt.payment.FinAccPaymentMethod;
 
 public class APRMActionHandler extends BaseActionHandler {
-  private static final Logger log = Logger.getLogger(APRMActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String BANK_TRANSITORY_CALLOUT_RESPONSE = "bankTransitoryCalloutResponse";
 
   @Override
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddMultiplePaymentsHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddMultiplePaymentsHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -19,10 +19,19 @@
 package org.openbravo.advpaymentmngt.actionHandler;
 
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -39,9 +48,12 @@
 import org.openbravo.service.json.JsonUtils;
 
 public class AddMultiplePaymentsHandler extends BaseProcessActionHandler {
-  private static final Logger log = Logger.getLogger(AddMultiplePaymentsHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final SimpleDateFormat jsDateFormat = JsonUtils.createDateFormat();
   private static final String ACTION_PROCESS_TRANSACTION = "P";
+  @Inject
+  @Any
+  private Instance<AddMultiplePaymentsProcessAfterProcessHook> afterHooks;
 
   @Override
   protected JSONObject doExecute(Map<String, Object> parameters, String data) {
@@ -56,16 +68,33 @@
       final String strAccountId = jsonData.getString("Fin_Financial_Account_ID");
 
       int selectedPaymentsLength = selectedPayments.length();
-      if (selectedPaymentsLength == 0) {
-        // Validation error: No lines selected
-        return getErrorMessage(OBMessageUtils.messageBD("APRM_NO_PAYMENTS_SELECTED"));
-      }
 
       for (int i = 0; i < selectedPaymentsLength; i++) {
         final JSONObject paymentJS = selectedPayments.getJSONObject(i);
         createAndProcessTransactionFromPayment(paymentJS, statementDate, dateAcct, strAccountId);
         OBDal.getInstance().getSession().clear();
       }
+
+      List<AddMultiplePaymentsProcessAfterProcessHook> hooksPriority = new ArrayList<AddMultiplePaymentsProcessAfterProcessHook>();
+      for (AddMultiplePaymentsProcessAfterProcessHook hook : afterHooks) {
+        hooksPriority.add(hook);
+      }
+      Collections.sort(hooksPriority, new Comparator<AddMultiplePaymentsProcessAfterProcessHook>() {
+        @Override
+        public int compare(AddMultiplePaymentsProcessAfterProcessHook o1,
+            AddMultiplePaymentsProcessAfterProcessHook o2) {
+          return (int) Math.signum(o2.getPriority() - o1.getPriority());
+        }
+      });
+      for (AddMultiplePaymentsProcessAfterProcessHook hook : hooksPriority) {
+        selectedPaymentsLength = selectedPaymentsLength + hook.executeHook(jsonData);
+      }
+
+      if (selectedPaymentsLength == 0) {
+        // Validation error: No lines selected
+        return getErrorMessage(OBMessageUtils.messageBD("APRM_NO_PAYMENTS_SELECTED"));
+      }
+
       // Success Message
       return getSuccessMessage(String.format(
           OBMessageUtils.messageBD("APRM_MULTIPLE_TRANSACTIONS_ADDED"), selectedPaymentsLength));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddMultiplePaymentsProcessAfterProcessHook.java	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,31 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.advpaymentmngt.actionHandler;
+
+import org.codehaus.jettison.json.JSONObject;
+
+public abstract class AddMultiplePaymentsProcessAfterProcessHook {
+  private int priority = 100;
+
+  public abstract int executeHook(JSONObject data);
+
+  public int getPriority() {
+    return priority;
+  }
+}
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -77,11 +77,11 @@
 import org.openbravo.service.db.DalConnectionProvider;
 import org.openbravo.service.db.DbUtility;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddPaymentActionHandler extends BaseProcessActionHandler {
-  final private static Logger log = LoggerFactory.getLogger(AddPaymentActionHandler.class);
+  final private static Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject doExecute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentDisplayLogicActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentDisplayLogicActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -36,12 +36,11 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.service.db.DbUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddPaymentDisplayLogicActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(AddPaymentDisplayLogicActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected final JSONObject execute(Map<String, Object> parameters, String data) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentOnProcessActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentOnProcessActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -32,11 +32,11 @@
 import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 import org.openbravo.service.db.DbUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddPaymentOnProcessActionHandler extends BaseActionHandler {
-  private static Logger log = LoggerFactory.getLogger(AddPaymentOnProcessActionHandler.class);
+  private static Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String data) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentReloadLabelsActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentReloadLabelsActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -34,12 +34,11 @@
 import org.openbravo.model.ad.ui.Element;
 import org.openbravo.model.ad.ui.ElementTrl;
 import org.openbravo.service.db.DbUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddPaymentReloadLabelsActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(AddPaymentReloadLabelsActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String data) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddTransactionActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddTransactionActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -52,11 +52,11 @@
 import org.openbravo.service.db.DalConnectionProvider;
 import org.openbravo.service.db.DbUtility;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddTransactionActionHandler extends BaseProcessActionHandler {
-  private static final Logger log = LoggerFactory.getLogger(AddTransactionActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject doExecute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddTransactionOnChangePaymentActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddTransactionOnChangePaymentActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -28,8 +28,8 @@
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Handler in Match Statement window | Add new transaction, that controls the Payment field on
@@ -37,8 +37,7 @@
  * 
  */
 public class AddTransactionOnChangePaymentActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(AddTransactionOnChangePaymentActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String data) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/CheckExistsOverissueBinForRFCShipmentWH.java	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,72 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2018 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.advpaymentmngt.actionHandler;
+
+import java.util.Map;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.client.kernel.BaseActionHandler;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
+import org.openbravo.model.common.enterprise.Locator;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+
+public class CheckExistsOverissueBinForRFCShipmentWH extends BaseActionHandler {
+  private static final Logger log = LogManager.getLogger();
+
+  @Override
+  protected JSONObject execute(Map<String, Object> parameters, String data) {
+    JSONObject result = new JSONObject();
+    JSONObject errorMessage = new JSONObject();
+    try {
+      final JSONObject jsonData = new JSONObject(data);
+      final String warehouseId = jsonData.getString("warehouseId");
+      Locator overIssueBin = getOverissueBinForWarehouse(warehouseId);
+      result.put("overissueBin", overIssueBin != null ? overIssueBin.getId() : "");
+      result
+          .put("storageBin$_identifier", overIssueBin != null ? overIssueBin.getIdentifier() : "");
+    } catch (Exception e) {
+      log.error("Error parsing JSON Object.", e);
+      try {
+        errorMessage = new JSONObject();
+        errorMessage.put("severity", "error");
+        errorMessage.put("title", "Error");
+        errorMessage.put("text", "");
+        result.put("message", errorMessage);
+        result.put("overissueBin", "");
+        result.put("storageBin$_identifier", "");
+      } catch (Exception e2) {
+        log.error("Message could not be built", e2);
+      }
+    }
+    return result;
+  }
+
+  private Locator getOverissueBinForWarehouse(String warehouseId) {
+    StringBuilder sbHQL = new StringBuilder(" as sb");
+    sbHQL.append(" where sb.warehouse.id = :warehouseId");
+    sbHQL.append(" and sb.inventoryStatus.overissue = true");
+    OBQuery<Locator> sbQuery = OBDal.getInstance().createQuery(Locator.class, sbHQL.toString());
+    sbQuery.setNamedParameter("warehouseId", warehouseId);
+    sbQuery.setMaxResult(1);
+    return sbQuery.uniqueResult();
+  }
+}
\ No newline at end of file
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/CheckRecordChangedActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/CheckRecordChangedActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -34,11 +34,11 @@
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.model.financialmgmt.payment.FIN_BankStatementLine;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class CheckRecordChangedActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory.getLogger(CheckRecordChangedActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String data) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,7 +25,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -48,7 +49,7 @@
 import org.openbravo.service.db.DbUtility;
 
 public class DoubtFulDebtPickEditLines extends BaseProcessActionHandler {
-  private static final Logger log = Logger.getLogger(DoubtFulDebtPickEditLines.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject doExecute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/FindTransactionsToMatchActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/FindTransactionsToMatchActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -34,12 +34,11 @@
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 import org.openbravo.model.financialmgmt.payment.FIN_Reconciliation;
 import org.openbravo.service.db.DbUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class FindTransactionsToMatchActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(FindTransactionsToMatchActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String data) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/FundsTransferActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/FundsTransferActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -43,8 +43,8 @@
 import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This class implements the ability to transfer funds among financial accounts in a simple and
@@ -54,7 +54,7 @@
  */
 public class FundsTransferActionHandler extends BaseProcessActionHandler {
   private static final String ERROR_IN_PROCESS = "Error in process";
-  private static final Logger log = LoggerFactory.getLogger(FundsTransferActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String BP_DEPOSIT = "BPD";
   private static final String BP_WITHDRAWAL = "BPW";
   private static final String BANK_FEE = "BF";
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/FundsTransferOnChangeDepositToActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/FundsTransferOnChangeDepositToActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -24,12 +24,11 @@
 import org.openbravo.client.kernel.BaseActionHandler;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class FundsTransferOnChangeDepositToActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(FundsTransferOnChangeDepositToActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String data) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -34,11 +34,11 @@
 import org.openbravo.model.financialmgmt.payment.FIN_Reconciliation;
 import org.openbravo.service.db.DalConnectionProvider;
 import org.openbravo.service.db.DbUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class MatchStatementActionHandler extends BaseProcessActionHandler {
-  private static final Logger log = LoggerFactory.getLogger(MatchStatementActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String OK_ACTION = "OK";
 
   @Override
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementOnLoadActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementOnLoadActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -40,12 +40,11 @@
 import org.openbravo.model.financialmgmt.payment.FIN_Reconciliation;
 import org.openbravo.model.financialmgmt.payment.MatchingAlgorithm;
 import org.openbravo.service.db.DbUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class MatchStatementOnLoadActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(MatchStatementOnLoadActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementOnLoadGetPreferenceActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementOnLoadGetPreferenceActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -27,12 +27,11 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.model.ad.domain.Preference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class MatchStatementOnLoadGetPreferenceActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(MatchStatementOnLoadGetPreferenceActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ModifyPaymentPlanActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ModifyPaymentPlanActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -28,7 +28,8 @@
 import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -55,7 +56,7 @@
 public class ModifyPaymentPlanActionHandler extends BaseProcessActionHandler {
 
   private final AdvPaymentMngtDao dao = new AdvPaymentMngtDao();
-  private static final Logger log4j = Logger.getLogger(ModifyPaymentPlanActionHandler.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   @Override
   /**
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Tue Dec 11 12:26:44 2018 +0000
@@ -24,7 +24,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -41,7 +42,7 @@
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentScheduleDetail;
 
 public class PaymentProposalPickEditLines extends BaseProcessActionHandler {
-  private static Logger log = Logger.getLogger(PaymentProposalPickEditLines.class);
+  private static Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject doExecute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/UnMatchSelectedTransactionsActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/UnMatchSelectedTransactionsActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -40,12 +40,11 @@
 import org.openbravo.service.db.DbUtility;
 import org.openbravo.service.json.JsonUtils;
 import org.openbravo.service.json.OBStaleObjectException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class UnMatchSelectedTransactionsActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(UnMatchSelectedTransactionsActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String data) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/UnMatchTransactionActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/UnMatchTransactionActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -37,11 +37,11 @@
 import org.openbravo.service.db.DbUtility;
 import org.openbravo.service.json.JsonUtils;
 import org.openbravo.service.json.OBStaleObjectException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class UnMatchTransactionActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory.getLogger(UnMatchTransactionActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String data) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.java	Tue Dec 11 12:26:44 2018 +0000
@@ -31,7 +31,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
@@ -78,7 +79,7 @@
 public class AddTransaction extends HttpSecureAppServlet {
   private static final long serialVersionUID = 1L;
   private AdvPaymentMngtDao dao;
-  private static final Logger log = Logger.getLogger(AddTransaction.class);
+  private static final Logger log = LogManager.getLogger();
 
   public void doPost(HttpServletRequest request, HttpServletResponse response)
       throws ServletException, IOException {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/GLItemSelectorFilterExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/GLItemSelectorFilterExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -27,13 +27,13 @@
 import org.openbravo.client.application.FilterExpression;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.erpCommon.utility.Utility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class GLItemSelectorFilterExpression implements FilterExpression {
   private static final String INPAD_ORG_ID_PARAM = "inpadOrgId";
   private static final String AD_ORG_ID_PARAM = "ad_org_id";
-  private static final Logger log = LoggerFactory.getLogger(GLItemSelectorFilterExpression.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   public String getExpression(Map<String, String> requestMap) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/ReportReconciliation.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/ReportReconciliation.java	Tue Dec 11 12:26:44 2018 +0000
@@ -29,7 +29,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.ProjectionList;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
@@ -53,7 +54,7 @@
 
 public class ReportReconciliation extends HttpSecureAppServlet {
   private static final long serialVersionUID = 1L;
-  private static final Logger log = Logger.getLogger(ReportReconciliation.class);
+  private static final Logger log = LogManager.getLogger();
   final static String DETAIL = "DETAIL";
   final static String SUMMARY = "SUMMARY";
 
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_FinaccTransactionEventListener.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_FinaccTransactionEventListener.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 import javax.enterprise.event.Observes;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.advpaymentmngt.utility.APRMConstants;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.model.Entity;
@@ -39,7 +40,7 @@
 
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       FIN_FinaccTransaction.ENTITY_NAME) };
-  protected Logger logger = Logger.getLogger(this.getClass());
+  protected Logger logger = LogManager.getLogger();
 
   @Override
   protected Entity[] getObservedEntities() {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -32,12 +32,11 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentMethod;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddOrderOrInvoiceFilterExpression implements FilterExpression {
-  private static final Logger log = LoggerFactory
-      .getLogger(AddOrderOrInvoiceFilterExpression.class);
+  private static final Logger log = LogManager.getLogger();
   @Inject
   @Any
   private Instance<AddOrderOrInvoiceFilterExpressionHandler> addOrderOrInvoiceFilterExpressionHandlers;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpressionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpressionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -34,13 +34,12 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 @RequestScoped
 abstract class AddOrderOrInvoiceFilterExpressionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(AddOrderOrInvoiceFilterExpressionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   @Any
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -33,12 +33,11 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddPaymentDefaultValuesExpression implements FilterExpression {
-  private static final Logger log = LoggerFactory
-      .getLogger(AddPaymentDefaultValuesExpression.class);
+  private static final Logger log = LogManager.getLogger();
   @Inject
   @Any
   private Instance<AddPaymentDefaultValuesHandler> addPaymentFilterExpressionHandlers;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDisplayLogicsExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDisplayLogicsExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -33,12 +33,11 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddPaymentDisplayLogicsExpression implements FilterExpression {
-  private static final Logger log = LoggerFactory
-      .getLogger(AddPaymentDisplayLogicsExpression.class);
+  private static final Logger log = LogManager.getLogger();
   @Inject
   @Any
   private Instance<AddPaymentDisplayLogicsHandler> addPaymentFilterExpressionHandlers;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentReadOnlyLogicsExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentReadOnlyLogicsExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -33,12 +33,11 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class AddPaymentReadOnlyLogicsExpression implements FilterExpression {
-  private static final Logger log = LoggerFactory
-      .getLogger(AddPaymentReadOnlyLogicsExpression.class);
+  private static final Logger log = LogManager.getLogger();
   @Inject
   @Any
   private Instance<AddPaymentReadOnlyLogicsHandler> addPaymentFilterExpressionHandlers;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentReadOnlyLogicsHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentReadOnlyLogicsHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -31,15 +31,14 @@
 import org.openbravo.erpCommon.utility.PropertyException;
 import org.openbravo.erpCommon.utility.PropertyNotFoundException;
 import org.openbravo.model.ad.ui.Window;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 @RequestScoped
 // Public class to allow extend the functionality, for example Add Payment popup opening from menu
 public abstract class AddPaymentReadOnlyLogicsHandler {
 
-  private static final Logger logger = LoggerFactory
-      .getLogger(AddPaymentReadOnlyLogicsHandler.class);
+  private static final Logger logger = LogManager.getLogger();
 
   /**
    * boolean value to set document number read only logic
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddTransactionFilterExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddTransactionFilterExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -23,7 +23,8 @@
 import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.client.application.FilterExpression;
@@ -36,7 +37,7 @@
 //Public class to allow extend the functionality, for example Add Payment popup opening from menu
 public class AddTransactionFilterExpression implements FilterExpression {
 
-  private static final Logger log = Logger.getLogger(AddTransactionFilterExpression.class);
+  private static final Logger log = LogManager.getLogger();
   private Map<String, String> requestMap;
 
   @Override
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/BusinessPartnerCustomerFilterExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/BusinessPartnerCustomerFilterExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -2,14 +2,15 @@
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.client.application.FilterExpression;
 import org.openbravo.client.application.OBBindingsConstants;
 import org.openbravo.client.application.ParameterUtils;
 import org.openbravo.client.kernel.RequestContext;
 
 public class BusinessPartnerCustomerFilterExpression implements FilterExpression {
-  private Logger log = Logger.getLogger(BusinessPartnerCustomerFilterExpression.class);
+  private Logger log = LogManager.getLogger();
   private Map<String, String> requestMap;
   private String windowId;
   private String financialAccountWindowId = "94EAA455D2644E04AB25D93BE5157B6D";
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/BusinessPartnerVendorFilterExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/BusinessPartnerVendorFilterExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -2,14 +2,15 @@
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.client.application.FilterExpression;
 import org.openbravo.client.application.OBBindingsConstants;
 import org.openbravo.client.application.ParameterUtils;
 import org.openbravo.client.kernel.RequestContext;
 
 public class BusinessPartnerVendorFilterExpression implements FilterExpression {
-  private Logger log = Logger.getLogger(BusinessPartnerVendorFilterExpression.class);
+  private Logger log = LogManager.getLogger();
   private Map<String, String> requestMap;
   private String windowId;
   private String financialAccountWindowId = "94EAA455D2644E04AB25D93BE5157B6D";
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/FundsTransferGLItemDefaultValueExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/FundsTransferGLItemDefaultValueExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -29,8 +29,8 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.financialmgmt.gl.GLItem;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This class returns the default value for the GL Item Parameter of the Funds Transfer Process in
@@ -40,8 +40,7 @@
 public class FundsTransferGLItemDefaultValueExpression implements FilterExpression {
   private static final String INPAD_ORG_ID_PARAM = "inpadOrgId";
   private static final String AD_ORG_ID_PARAM = "ad_org_id";
-  private static final Logger log = LoggerFactory
-      .getLogger(FundsTransferGLItemDefaultValueExpression.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   public String getExpression(Map<String, String> requestMap) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/MatchStatementFilterExpression.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/MatchStatementFilterExpression.java	Tue Dec 11 12:26:44 2018 +0000
@@ -30,11 +30,11 @@
 import org.openbravo.client.application.FilterExpression;
 import org.openbravo.client.application.OBBindingsConstants;
 import org.openbravo.client.kernel.ComponentProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class MatchStatementFilterExpression implements FilterExpression {
-  private static final Logger log = LoggerFactory.getLogger(MatchStatementFilterExpression.class);
+  private static final Logger log = LogManager.getLogger();
   @Inject
   @Any
   private Instance<MatchStatementFilterExpressionHandler> matchStatementFilterExpressionHandlers;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/MatchStatementFilterExpressionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/MatchStatementFilterExpressionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -27,13 +27,12 @@
 
 import org.codehaus.jettison.json.JSONException;
 import org.openbravo.client.kernel.ComponentProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 @RequestScoped
 abstract class MatchStatementFilterExpressionHandler {
-  private static final Logger log = LoggerFactory
-      .getLogger(MatchStatementFilterExpressionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   @Any
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Tue Dec 11 12:26:44 2018 +0000
@@ -40,6 +40,7 @@
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.exception.OBException;
+import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.base.structure.BaseOBObject;
@@ -1389,14 +1390,16 @@
         firstDueDate = paymentSchedule.getDueDate();
     }
 
-    BigDecimal overdueAmount = calculateOverdueAmount(invoicePaymentSchedule);
-    invoice.setPercentageOverdue(overdueAmount.multiply(new BigDecimal("100"))
-        .divide(invoice.getGrandTotalAmount(), 2, RoundingMode.HALF_UP).longValue());
-
-    if (firstDueDate != null)
+    if (invoice.getGrandTotalAmount().compareTo(BigDecimal.ZERO) != 0) {
+      BigDecimal overdueAmount = calculateOverdueAmount(invoicePaymentSchedule);
+      invoice.setPercentageOverdue(overdueAmount.multiply(new BigDecimal("100"))
+          .divide(invoice.getGrandTotalAmount(), 2, RoundingMode.HALF_UP).longValue());
+    }
+    if (firstDueDate != null) {
       invoice.setDaysTillDue(FIN_Utility.getDaysToDue(firstDueDate));
-    else
+    } else {
       invoice.setDaysTillDue(0L);
+    }
     OBDal.getInstance().save(invoice);
   }
 
@@ -1737,4 +1740,62 @@
     }
     return BigDecimal.ZERO;
   }
+
+  /**
+   * Method to create a new Payment Schedule Detail (PSD)
+   * 
+   * @param amount
+   *          Amount of the PSD
+   * @param paymentSchedule
+   *          The PS that the PSD will belong to
+   * @param paymentScheduleInvoice
+   *          The PS Invoice that the PSD will belong to
+   * @param businessPartner
+   *          The BP of the PSD
+   * @return newPSD The newly created PSD
+   */
+  public static FIN_PaymentScheduleDetail createPSD(BigDecimal amount,
+      FIN_PaymentSchedule paymentSchedule, FIN_PaymentSchedule paymentScheduleInvoice,
+      Organization organization, BusinessPartner businessPartner) {
+    return createPSD(amount, paymentSchedule, paymentScheduleInvoice, null, organization,
+        businessPartner);
+  }
+
+  /**
+   * Method to create a new Payment Schedule Detail (PSD)
+   * 
+   * @param amount
+   *          Amount of the PSD
+   * @param paymentSchedule
+   *          The PS that the PSD will belong to
+   * @param paymentScheduleInvoice
+   *          The PS Invoice that the PSD will belong to
+   * @param paymentDetails
+   *          The PD to which the PSD will be related
+   * @param businessPartner
+   *          The BP of the PSD
+   * @return newPSD The newly created PSD
+   */
+  public static FIN_PaymentScheduleDetail createPSD(BigDecimal amount,
+      FIN_PaymentSchedule paymentSchedule, FIN_PaymentSchedule paymentScheduleInvoice,
+      FIN_PaymentDetail paymentDetails, Organization organization, BusinessPartner businessPartner) {
+    final FIN_PaymentScheduleDetail newPSD = OBProvider.getInstance().get(
+        FIN_PaymentScheduleDetail.class);
+    newPSD.setAmount(amount);
+    if (paymentSchedule != null) {
+      newPSD.setOrderPaymentSchedule(paymentSchedule);
+      paymentSchedule.getFINPaymentScheduleDetailOrderPaymentScheduleList().add(newPSD);
+    }
+    if (paymentScheduleInvoice != null) {
+      newPSD.setInvoicePaymentSchedule(paymentScheduleInvoice);
+      paymentScheduleInvoice.getFINPaymentScheduleDetailInvoicePaymentScheduleList().add(newPSD);
+    }
+    newPSD.setPaymentDetails(paymentDetails);
+    newPSD.setOrganization(organization);
+    newPSD.setBusinessPartner(businessPartner);
+    OBDal.getInstance().save(newPSD);
+
+    return newPSD;
+  }
+
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Tue Dec 11 12:26:44 2018 +0000
@@ -24,7 +24,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.MatchTransactionDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
@@ -45,7 +46,7 @@
 
 public class FIN_BankStatementProcess implements org.openbravo.scheduling.Process {
 
-  private static final Logger log = Logger.getLogger(FIN_BankStatementProcess.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   public void execute(ProcessBundle bundle) throws Exception {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.secureApp.VariablesSecureApp;
@@ -39,7 +40,7 @@
 
 public class FIN_DoubtfulDebtProcess implements org.openbravo.scheduling.Process {
   private static AdvPaymentMngtDao dao;
-  private static final Logger log4j = Logger.getLogger(FIN_DoubtfulDebtProcess.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   public void execute(ProcessBundle bundle) throws Exception {
     dao = new AdvPaymentMngtDao();
@@ -132,16 +133,25 @@
 
   private void updateDoubtfulDebtScheduleDetails(FIN_PaymentSchedule salesInvoicePaymentSchedule,
       BigDecimal debtAmount) {
+    BigDecimal pendingDebtAmount = debtAmount;
     for (FIN_PaymentScheduleDetail psd : salesInvoicePaymentSchedule
         .getFINPaymentScheduleDetailInvoicePaymentScheduleList()) {
       if (psd.getPaymentDetails() == null) {
         // Pending amount should be greater or equals than the doubtful debt amount
-        if (psd.getAmount().compareTo(debtAmount) >= 0) {
-          psd.setDoubtfulDebtAmount(psd.getDoubtfulDebtAmount().add(debtAmount));
+        if (psd.getAmount().compareTo(pendingDebtAmount) >= 0) {
+          psd.setDoubtfulDebtAmount(psd.getDoubtfulDebtAmount().add(pendingDebtAmount));
+          OBDal.getInstance().save(psd);
+        } else {
+          psd.setDoubtfulDebtAmount(psd.getDoubtfulDebtAmount().add(psd.getAmount()));
+          pendingDebtAmount = getDifferenceOfAmountsOrZero(pendingDebtAmount, psd);
           OBDal.getInstance().save(psd);
         }
       }
     }
   }
 
+  private BigDecimal getDifferenceOfAmountsOrZero(BigDecimal debtAmountAux, FIN_PaymentScheduleDetail psd) {
+    return debtAmountAux.subtract(psd.getAmount()).compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO
+        : debtAmountAux.subtract(psd.getAmount());
+  }
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtRunProcess.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtRunProcess.java	Tue Dec 11 12:26:44 2018 +0000
@@ -20,7 +20,8 @@
 
 import java.util.HashMap;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.secureApp.VariablesSecureApp;
@@ -35,7 +36,7 @@
 
 public class FIN_DoubtfulDebtRunProcess implements org.openbravo.scheduling.Process {
   private static AdvPaymentMngtDao dao;
-  private static final Logger log4j = Logger.getLogger(FIN_DoubtfulDebtRunProcess.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   public void execute(ProcessBundle bundle) throws Exception {
     dao = new AdvPaymentMngtDao();
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,7 +25,8 @@
 import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.dao.TransactionsDao;
 import org.openbravo.advpaymentmngt.exception.NoExecutionProcessFoundException;
@@ -62,7 +63,7 @@
   private HashMap<String, String> parameters = new HashMap<String, String>();
   private HashMap<String, String> internalParameters = new HashMap<String, String>();
   private PaymentRun paymentRun;
-  private static final Logger log = Logger.getLogger(FIN_ExecutePayment.class);
+  private static final Logger log = LogManager.getLogger();
 
   public void init(String sourceType, PaymentExecutionProcess _executionProcess,
       List<FIN_Payment> payments, HashMap<String, String> _parameters, Organization organization)
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Tue Dec 11 12:26:44 2018 +0000
@@ -64,14 +64,14 @@
 import org.openbravo.model.financialmgmt.payment.FinAccPaymentMethod;
 import org.openbravo.model.financialmgmt.payment.PaymentExecutionProcess;
 import org.openbravo.scheduling.ProcessBundle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class FIN_PaymentProcess implements org.openbravo.scheduling.Process {
   private static AdvPaymentMngtDao dao;
 
   public BigDecimal ZERO = BigDecimal.ZERO;
-  static Logger log4j = LoggerFactory.getLogger(FIN_PaymentProcess.class);
+  static Logger log4j = LogManager.getLogger();
 
   public void execute(ProcessBundle bundle) throws Exception {
 
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProposalProcess.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProposalProcess.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,7 +25,8 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.exception.OBException;
@@ -53,11 +54,11 @@
 
   public static final String COMINGFROM_PAYMENTPROPOSALPROCESS = "PAYMENT_PROPOSAL";
 
-  private static final Logger log = Logger.getLogger(FIN_PaymentProposalProcess.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   public void execute(ProcessBundle bundle) throws Exception {
-    final Logger log4j = Logger.getLogger(this.getClass());
+    final Logger log4j = LogManager.getLogger();
     dao = new AdvPaymentMngtDao();
     OBError message = null;
     try {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Tue Dec 11 12:26:44 2018 +0000
@@ -20,7 +20,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
@@ -42,7 +43,7 @@
 
 public class FIN_ReconciliationProcess implements org.openbravo.scheduling.Process {
   private static AdvPaymentMngtDao dao;
-  private static final Logger log = Logger.getLogger(FIN_ReconciliationProcess.class);
+  private static final Logger log = LogManager.getLogger();
 
   public void execute(ProcessBundle bundle) throws Exception {
     dao = new AdvPaymentMngtDao();
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionModify.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionModify.java	Tue Dec 11 12:26:44 2018 +0000
@@ -20,7 +20,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
@@ -47,7 +48,7 @@
 
 public class FIN_TransactionModify implements org.openbravo.scheduling.Process {
   private static AdvPaymentMngtDao dao;
-  private static final Logger log = Logger.getLogger(FIN_TransactionModify.class);
+  private static final Logger log = LogManager.getLogger();
 
   public void execute(ProcessBundle bundle) throws Exception {
     dao = new AdvPaymentMngtDao();
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,10 +22,9 @@
 import java.util.List;
 
 import org.apache.commons.lang.StringUtils;
-import org.hibernate.LockOptions;
-import org.hibernate.Session;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
-import org.hibernate.query.Query;
 import org.openbravo.advpaymentmngt.APRM_FinaccTransactionV;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
@@ -49,15 +48,13 @@
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentScheduleDetail;
 import org.openbravo.model.financialmgmt.payment.FinAccPaymentMethod;
 import org.openbravo.scheduling.ProcessBundle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class FIN_TransactionProcess implements org.openbravo.scheduling.Process {
   /** Transaction type - Financial Account */
   public static final String TRXTYPE_BPDeposit = "BPD";
   public static final String TRXTYPE_BPWithdrawal = "BPW";
   public static final String TRXTYPE_BankFee = "BF";
-  static Logger log4j = LoggerFactory.getLogger(FIN_TransactionProcess.class);
+  static Logger log4j = LogManager.getLogger();
 
   public void execute(ProcessBundle bundle) throws Exception {
     OBError msg = new OBError();
@@ -115,10 +112,6 @@
           msg = OBMessageUtils.messageBD("PeriodNotAvailable");
           throw new OBException(msg);
         }
-
-        final FIN_FinancialAccount financialAccount = lockFinAccount(transaction.getAccount());
-        financialAccount.setCurrentBalance(financialAccount.getCurrentBalance().add(
-            transaction.getDepositAmount().subtract(transaction.getPaymentAmount())));
         transaction.setProcessed(true);
         FIN_Payment payment = transaction.getFinPayment();
         if (payment != null) {
@@ -127,8 +120,8 @@
           }
           AdvPaymentMngtDao dao = new AdvPaymentMngtDao();
           if (StringUtils.equals(payment.getStatus(), dao.PAYMENT_STATUS_AWAITING_EXECUTION)
-              && dao.isAutomatedExecutionPayment(financialAccount, payment.getPaymentMethod(),
-                  payment.isReceipt())) {
+              && dao.isAutomatedExecutionPayment(transaction.getAccount(),
+                  payment.getPaymentMethod(), payment.isReceipt())) {
             msg = OBMessageUtils.messageBD("APRM_AutomaticExecutionProcess");
             throw new OBException(msg);
           }
@@ -176,8 +169,13 @@
             && getConversionRateDocument(transaction).size() == 0) {
           insertConversionRateDocument(transaction);
         }
+
+        FIN_FinancialAccount financialAccount = OBDal.getInstance().getObjectLockForNoKeyUpdate(
+            transaction.getAccount());
+
+        financialAccount.setCurrentBalance(financialAccount.getCurrentBalance().add(
+            transaction.getDepositAmount().subtract(transaction.getPaymentAmount())));
         transaction.setAprmProcessed("R");
-        OBDal.getInstance().save(financialAccount);
         OBDal.getInstance().save(transaction);
 
       } else if (strAction.equals("R") && transaction.isProcessed()) {
@@ -221,10 +219,7 @@
           OBContext.restorePreviousMode();
         }
         transaction.setProcessed(false);
-        final FIN_FinancialAccount financialAccount = lockFinAccount(transaction.getAccount());
-        financialAccount.setCurrentBalance(financialAccount.getCurrentBalance()
-            .subtract(transaction.getDepositAmount()).add(transaction.getPaymentAmount()));
-        OBDal.getInstance().save(financialAccount);
+
         OBDal.getInstance().save(transaction);
         if (payment != null) {
           Boolean invoicePaidold = false;
@@ -247,6 +242,10 @@
           transaction.setStatus(transaction.getDepositAmount().compareTo(
               transaction.getPaymentAmount()) > 0 ? "RPR" : "PPM");
         }
+        FIN_FinancialAccount financialAccount = OBDal.getInstance().getObjectLockForNoKeyUpdate(
+            transaction.getAccount());
+        financialAccount.setCurrentBalance(financialAccount.getCurrentBalance()
+            .subtract(transaction.getDepositAmount()).add(transaction.getPaymentAmount()));
         transaction.setAprmProcessed("P");
         OBDal.getInstance().save(transaction);
       }
@@ -368,18 +367,4 @@
     }
     return confirmation;
   }
-
-  private static FIN_FinancialAccount lockFinAccount(FIN_FinancialAccount account) {
-    StringBuilder queryStr = new StringBuilder(
-        "select a from FIN_Financial_Account a where id = :id");
-    final Session session = OBDal.getInstance().getSession();
-    final Query<FIN_FinancialAccount> query = session.createQuery(queryStr.toString(),
-        FIN_FinancialAccount.class);
-    query.setParameter("id", account.getId());
-    query.setMaxResults(1);
-    query.setLockOptions(LockOptions.UPGRADE);
-    OBDal.getInstance().getSession().evict(account);
-    return query.uniqueResult();
-  }
-
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/APRM_MatchingUtility.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/APRM_MatchingUtility.java	Tue Dec 11 12:26:44 2018 +0000
@@ -80,11 +80,11 @@
 import org.openbravo.scheduling.ProcessBundle;
 import org.openbravo.service.db.CallStoredProcedure;
 import org.openbravo.service.db.DalConnectionProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class APRM_MatchingUtility {
-  private static final Logger log4j = LoggerFactory.getLogger(APRM_MatchingUtility.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   /**
    * Get reconciliation lines of a reconciliation that had been matched manually
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Tue Dec 11 12:26:44 2018 +0000
@@ -31,7 +31,8 @@
 
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.ScrollMode;
 import org.hibernate.ScrollableResults;
 import org.hibernate.criterion.Restrictions;
@@ -64,7 +65,7 @@
   private FIN_FinancialAccount financialAccount;
   OBError myError = null;
   String filename = "";
-  private static Logger log4j = Logger.getLogger(FIN_BankStatementImport.class);
+  private static Logger log4j = LogManager.getLogger();
 
   public static final String DOCUMENT_BankStatementFile = "BSF";
 
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Tue Dec 11 12:26:44 2018 +0000
@@ -80,11 +80,11 @@
 import org.openbravo.service.db.CallStoredProcedure;
 import org.openbravo.service.db.DbUtility;
 import org.openbravo.utils.Replace;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class FIN_Utility {
-  private static final Logger log4j = LoggerFactory.getLogger(FIN_Utility.class);
+  private static final Logger log4j = LogManager.getLogger();
   private static AdvPaymentMngtDao dao;
 
   /**
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Tue Dec 11 12:26:44 2018 +0000
@@ -128,6 +128,8 @@
   orderInvoiceGrid.dataProperties.transformData = OB.APRM.AddPayment.ordInvTransformData;
   glitemGrid.removeRecordClick = OB.APRM.AddPayment.removeRecordClick;
   creditUseGrid.selectionChanged = OB.APRM.AddPayment.selectionChangedCredit;
+  creditUseGrid.userSelectAllRecords = OB.APRM.AddPayment.userSelectAllRecords;
+  creditUseGrid.deselectAllRecords = OB.APRM.AddPayment.deselectAllRecords;
   orderInvoiceGrid.dataArrived = OB.APRM.AddPayment.ordInvDataArrived;
 
   form.isCreditAllowed = form.getItem('received_from').getValue() !== undefined && form.getItem('received_from').getValue() !== null;
@@ -336,6 +338,9 @@
 
 OB.APRM.AddPayment.creditOnLoadGrid = function (grid) {
   grid.isReady = true;
+  if (grid.obaprmAllRecordsSelectedByUser) {
+    delete grid.obaprmAllRecordsSelectedByUser;
+  }
   OB.APRM.AddPayment.updateCreditTotal(this.view.theForm);
   OB.APRM.AddPayment.tryToUpdateActualExpected(this.view.theForm);
 };
@@ -843,10 +848,12 @@
   } else {
     grid.setEditValue(grid.getRecordIndex(record), amountField, '0');
   }
-  OB.APRM.AddPayment.updateCreditTotal(view.theForm);
-  OB.APRM.AddPayment.updateActualExpected(view.theForm);
-  if (issotrx) {
-    OB.APRM.AddPayment.distributeAmount(view, view.theForm, true);
+  if (!grid.obaprmAllRecordsSelectedByUser || (grid.obaprmAllRecordsSelectedByUser && (grid.getRecordIndex(record) === grid.getTotalRows() - 1))) {
+    OB.APRM.AddPayment.updateCreditTotal(view.theForm);
+    OB.APRM.AddPayment.updateActualExpected(view.theForm);
+    if (issotrx) {
+      OB.APRM.AddPayment.distributeAmount(view, view.theForm, true);
+    }
   }
 };
 
--- a/modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/ConnectionInitializerInterceptor.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/ConnectionInitializerInterceptor.java	Tue Dec 11 12:26:44 2018 +0000
@@ -18,15 +18,15 @@
  */
 package org.openbravo.apachejdbcconnectionpool;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
-import java.util.HashMap;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.tomcat.jdbc.pool.ConnectionPool;
 import org.apache.tomcat.jdbc.pool.JdbcInterceptor;
 import org.apache.tomcat.jdbc.pool.PooledConnection;
-import org.openbravo.base.exception.OBException;
 import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.database.PoolInterceptorProvider;
 import org.openbravo.database.SessionInfo;
@@ -40,6 +40,7 @@
 
   private static final String SESSION_CONFIG_APPLIED = "OB_INITIALIZED";
   private static final String SESSION_INFO_APPLIED = "SESSION_INFO_INITIALIZED";
+  private static final String CACHED_CONNECTION = "CACHED_CONNECTION";
 
   String rbdms = (String) OBPropertiesProvider.getInstance().getOpenbravoProperties()
       .get("bbdd.rdbms");
@@ -50,46 +51,66 @@
    */
   @Override
   public void reset(ConnectionPool parent, PooledConnection con) {
-    if (con != null) {
-      HashMap<Object, Object> attributes = con.getAttributes();
-      Boolean sessionInfoApplied = (Boolean) attributes.get(SESSION_CONFIG_APPLIED);
-      if (sessionInfoApplied == null || !sessionInfoApplied) {
-        PreparedStatement pstmt = null;
-        try {
-          final Properties props = OBPropertiesProvider.getInstance().getOpenbravoProperties();
-          final String dbSessionConfig = props.getProperty("bbdd.sessionConfig");
-          pstmt = con.getConnection().prepareStatement(dbSessionConfig);
-          pstmt.executeQuery();
-        } catch (Exception e) {
-          throw new IllegalStateException(e);
-        } finally {
-          try {
-            if (pstmt != null && !pstmt.isClosed()) {
-              pstmt.close();
-            }
-          } catch (SQLException e) {
-            throw new OBException(e);
-          }
-        }
-        attributes.put(SESSION_CONFIG_APPLIED, true);
+    if (con == null) {
+      return;
+    }
+
+    boolean physicalConnectionChanged = hasPhysicalConnectionChanged(con);
+
+    Map<Object, Object> attributes = con.getAttributes();
+    Boolean sessionInfoApplied = (Boolean) attributes.get(SESSION_CONFIG_APPLIED);
+    if (physicalConnectionChanged || sessionInfoApplied == null || !sessionInfoApplied) {
+      final Properties props = OBPropertiesProvider.getInstance().getOpenbravoProperties();
+      final String dbSessionConfig = props.getProperty("bbdd.sessionConfig");
+      try (PreparedStatement pstmt = con.getConnection().prepareStatement(dbSessionConfig)) {
+        pstmt.executeQuery();
+      } catch (SQLException e) {
+        throw new IllegalStateException(e);
       }
+      attributes.put(SESSION_CONFIG_APPLIED, true);
+    }
 
-      Boolean sessionInfoInitialized = (Boolean) attributes.get(SESSION_INFO_APPLIED);
-      if (sessionInfoInitialized == null || !sessionInfoInitialized) {
-        boolean initialized = false;
-        if (isReadOnlyPool(parent)) {
-          initialized = true;
-        } else {
-          // SessionInfo will be initialized when the SessionListener ServletContextListener is
-          // invoked. That listener will check if there are audited tables and notify SessionInfo,
-          // from then on SessionInfo will know whether the ad_context_info table should be created
-          if (SessionInfo.isInitialized()) {
-            SessionInfo.initDB(con.getConnection(), rbdms);
-            initialized = true;
-          }
-        }
-        attributes.put(SESSION_INFO_APPLIED, initialized);
+    Boolean sessionInfoInitialized = (Boolean) attributes.get(SESSION_INFO_APPLIED);
+    if (physicalConnectionChanged || sessionInfoInitialized == null || !sessionInfoInitialized) {
+      boolean initialized = false;
+      if (isReadOnlyPool(parent)) {
+        initialized = true;
+      } else if (SessionInfo.isInitialized()) {
+        // SessionInfo will be initialized when the SessionListener ServletContextListener is
+        // invoked. That listener will check if there are audited tables and notify SessionInfo,
+        // from then on SessionInfo will know whether the ad_context_info table should be created
+        SessionInfo.initDB(con.getConnection(), rbdms);
+        initialized = true;
       }
+      attributes.put(SESSION_INFO_APPLIED, initialized);
+    }
+
+    cachePhysicalConnection(con);
+  }
+
+  /**
+   * The physical database {@code Connection} associated with a {@code PooledConnection} can change
+   * in case it was invalid when trying to borrow it. We need to track it in order to properly
+   * initialize connections also in this case.
+   */
+  private boolean hasPhysicalConnectionChanged(PooledConnection con) {
+    Connection physicalConn = con.getConnection();
+    if (physicalConn == null) {
+      return false;
+    }
+
+    Connection storedConn = (Connection) con.getAttributes().get(CACHED_CONNECTION);
+    if (storedConn == null) {
+      return false;
+    }
+
+    return physicalConn != storedConn;
+  }
+
+  private void cachePhysicalConnection(PooledConnection con) {
+    Connection storedConn = (Connection) con.getAttributes().get(CACHED_CONNECTION);
+    if (storedConn == null || hasPhysicalConnectionChanged(con)) {
+      con.getAttributes().put(CACHED_CONNECTION, con.getConnection());
     }
   }
 
--- a/modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/JdbcExternalConnectionPool.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/JdbcExternalConnectionPool.java	Tue Dec 11 12:26:44 2018 +0000
@@ -19,6 +19,7 @@
 package org.openbravo.apachejdbcconnectionpool;
 
 import java.sql.Connection;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -30,6 +31,7 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.tomcat.jdbc.pool.DataSource;
+import org.apache.tomcat.jdbc.pool.PoolExhaustedException;
 import org.apache.tomcat.jdbc.pool.PoolProperties;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.session.OBPropertiesProvider;
@@ -37,8 +39,8 @@
 import org.openbravo.database.ExternalConnectionPool;
 import org.openbravo.database.PoolInterceptorProvider;
 import org.openbravo.jmx.MBeanRegistry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * JdbcExternalConnectionPool manages all the functionality of the Apache JDBC Connection Pool. This
@@ -47,12 +49,14 @@
  * connection from a pool, close the different pools and other actions.
  */
 public class JdbcExternalConnectionPool extends ExternalConnectionPool {
-
-  final static private Logger log = LoggerFactory.getLogger(JdbcExternalConnectionPool.class);
+  final static private Logger log = LogManager.getLogger();
 
   private Map<String, DataSource> availableDataSources = null;
   private DataSource defaultDataSource = null;
 
+  private static final List<Class<? extends Exception>> EXHAUSTED_EXCEPTION = Arrays
+      .asList(PoolExhaustedException.class);
+
   /**
    * This method loads all the interceptors of Apache JDBC Connection Pool injected with weld.
    */
@@ -349,4 +353,10 @@
     }
     super.closePool();
   }
+
+  @Override
+  protected List<Class<? extends Exception>> getExhaustedExceptions() {
+    return EXHAUSTED_EXCEPTION;
+  }
+
 }
Binary file modules/org.openbravo.base.weld/lib/runtime/slf4j-ext-1.6.1.jar has changed
Binary file modules/org.openbravo.base.weld/lib/runtime/slf4j-ext-1.7.25.jar has changed
--- a/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/ParameterCdiTestRule.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/ParameterCdiTestRule.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,8 +25,8 @@
 import org.junit.rules.MethodRule;
 import org.junit.runners.model.FrameworkMethod;
 import org.junit.runners.model.Statement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Rule to make possible to run parameterized test cases with Arquillian runner. The Rule field
@@ -40,7 +40,7 @@
  */
 public class ParameterCdiTestRule<T> implements MethodRule {
   private final List<T> params;
-  private static final Logger log = LoggerFactory.getLogger(ParameterCdiTestRule.class);
+  private static final Logger log = LogManager.getLogger();
 
   public ParameterCdiTestRule(List<T> params) {
     if (params == null || params.size() == 0) {
--- a/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -45,8 +45,8 @@
 import org.openbravo.dal.core.OBInterceptor;
 import org.openbravo.dal.core.SQLFunctionRegister;
 import org.openbravo.test.base.OBBaseTest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Base test for weld, provides access to the weld container.
@@ -55,7 +55,7 @@
  */
 @RunWith(Arquillian.class)
 public class WeldBaseTest extends OBBaseTest {
-  private static final Logger log = LoggerFactory.getLogger(WeldBaseTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static boolean initialized = false;
   private static JavaArchive archive = null;
--- a/modules/org.openbravo.base.weld/src/org/openbravo/base/weld/WeldUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.base.weld/src/org/openbravo/base/weld/WeldUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -33,8 +33,8 @@
 
 import org.openbravo.base.exception.OBException;
 import org.openbravo.dal.core.DalContextListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Provides weld utilities.
@@ -45,7 +45,7 @@
 public class WeldUtils {
 
   private static BeanManager staticBeanManager = null;
-  private static final Logger log = LoggerFactory.getLogger(WeldUtils.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String BEAN_MANAGER_ATTRIBUTE_NAME = "org.jboss.weld.environment.servlet.javax.enterprise.inject.spi.BeanManager";
 
   public static BeanManager getStaticInstanceBeanManager() {
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_COLUMN.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_COLUMN.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -4005,6 +4005,43 @@
 <!--55250700311A4AB7A00E1DDECF209FF3-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--55250700311A4AB7A00E1DDECF209FF3--></AD_COLUMN>
 
+<!--555D6DAB70824E5FB990905BEC22EEA7--><AD_COLUMN>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <AD_COLUMN_ID><![CDATA[555D6DAB70824E5FB990905BEC22EEA7]]></AD_COLUMN_ID>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <NAME><![CDATA[Logger]]></NAME>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <DESCRIPTION><![CDATA[Logger name]]></DESCRIPTION>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <HELP><![CDATA[Name used to identify a Logger. It usually corresponds to the name of the class being logged, but it can also be named using an arbitrary name.]]></HELP>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <COLUMNNAME><![CDATA[logger]]></COLUMNNAME>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <AD_TABLE_ID><![CDATA[ED87AD8D00DE4CC79B9BB66F3E90B78B]]></AD_TABLE_ID>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <FIELDLENGTH><![CDATA[200]]></FIELDLENGTH>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <AD_ELEMENT_ID><![CDATA[4F9B5A7E1E744830A7378CC67D3BCFD2]]></AD_ELEMENT_ID>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--555D6DAB70824E5FB990905BEC22EEA7-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--555D6DAB70824E5FB990905BEC22EEA7--></AD_COLUMN>
+
 <!--55C1A4EE91644D1FB2A083FF546867BB--><AD_COLUMN>
 <!--55C1A4EE91644D1FB2A083FF546867BB-->  <AD_COLUMN_ID><![CDATA[55C1A4EE91644D1FB2A083FF546867BB]]></AD_COLUMN_ID>
 <!--55C1A4EE91644D1FB2A083FF546867BB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -5558,6 +5595,45 @@
 <!--7624A1EDFA5A48D4B33A00A5AD18FEB3-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--7624A1EDFA5A48D4B33A00A5AD18FEB3--></AD_COLUMN>
 
+<!--780C755C3A81447ABBD830D22038D1CB--><AD_COLUMN>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <AD_COLUMN_ID><![CDATA[780C755C3A81447ABBD830D22038D1CB]]></AD_COLUMN_ID>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <NAME><![CDATA[Level]]></NAME>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <DESCRIPTION><![CDATA[Logger log level]]></DESCRIPTION>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <HELP><![CDATA[Indicates the minimum level events should have for this Logger to process them. By default this level is determined by
+the config files: it is inherited from the root logger unless an specific configuration for this class/package is defined.]]></HELP>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <COLUMNNAME><![CDATA[level]]></COLUMNNAME>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <AD_TABLE_ID><![CDATA[ED87AD8D00DE4CC79B9BB66F3E90B78B]]></AD_TABLE_ID>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <AD_REFERENCE_VALUE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_VALUE_ID>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <AD_ELEMENT_ID><![CDATA[C453BC52FD694241864B69AE2C0F48FB]]></AD_ELEMENT_ID>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--780C755C3A81447ABBD830D22038D1CB-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--780C755C3A81447ABBD830D22038D1CB--></AD_COLUMN>
+
 <!--7908F76076C54215A06C9F3FA47C296E--><AD_COLUMN>
 <!--7908F76076C54215A06C9F3FA47C296E-->  <AD_COLUMN_ID><![CDATA[7908F76076C54215A06C9F3FA47C296E]]></AD_COLUMN_ID>
 <!--7908F76076C54215A06C9F3FA47C296E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -9414,6 +9490,41 @@
 <!--ABEE9EA6CC8344789ADA2ABC532DA2FF-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--ABEE9EA6CC8344789ADA2ABC532DA2FF--></AD_COLUMN>
 
+<!--AC10D2D19BA34F2384F87DC26F1595B9--><AD_COLUMN>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <AD_COLUMN_ID><![CDATA[AC10D2D19BA34F2384F87DC26F1595B9]]></AD_COLUMN_ID>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <NAME><![CDATA[id]]></NAME>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <COLUMNNAME><![CDATA[id]]></COLUMNNAME>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <AD_TABLE_ID><![CDATA[ED87AD8D00DE4CC79B9BB66F3E90B78B]]></AD_TABLE_ID>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <FIELDLENGTH><![CDATA[200]]></FIELDLENGTH>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISKEY><![CDATA[Y]]></ISKEY>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <AD_ELEMENT_ID><![CDATA[0203C4D611382746E050007F0100412C]]></AD_ELEMENT_ID>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--AC10D2D19BA34F2384F87DC26F1595B9-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--AC10D2D19BA34F2384F87DC26F1595B9--></AD_COLUMN>
+
 <!--AC86B3B9E5E44263BE8B2814868E469A--><AD_COLUMN>
 <!--AC86B3B9E5E44263BE8B2814868E469A-->  <AD_COLUMN_ID><![CDATA[AC86B3B9E5E44263BE8B2814868E469A]]></AD_COLUMN_ID>
 <!--AC86B3B9E5E44263BE8B2814868E469A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -340,6 +340,20 @@
 <!--4F42DE67C7DE44F6AD3C24E7C3B13844-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--4F42DE67C7DE44F6AD3C24E7C3B13844--></AD_ELEMENT>
 
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2--><AD_ELEMENT>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <AD_ELEMENT_ID><![CDATA[4F9B5A7E1E744830A7378CC67D3BCFD2]]></AD_ELEMENT_ID>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <COLUMNNAME><![CDATA[logger]]></COLUMNNAME>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <NAME><![CDATA[Logger]]></NAME>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <PRINTNAME><![CDATA[Logger]]></PRINTNAME>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <DESCRIPTION><![CDATA[Logger name]]></DESCRIPTION>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <HELP><![CDATA[Name used to identify a Logger. It usually corresponds to the name of the class being logged, but it can also be named using an arbitrary name.]]></HELP>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--4F9B5A7E1E744830A7378CC67D3BCFD2--></AD_ELEMENT>
+
 <!--50069593057E4B64AE1FCF29E2898A74--><AD_ELEMENT>
 <!--50069593057E4B64AE1FCF29E2898A74-->  <AD_ELEMENT_ID><![CDATA[50069593057E4B64AE1FCF29E2898A74]]></AD_ELEMENT_ID>
 <!--50069593057E4B64AE1FCF29E2898A74-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -709,6 +723,18 @@
 <!--9EAE872F6F394DE3AB3BE9AE2B8C7E73-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--9EAE872F6F394DE3AB3BE9AE2B8C7E73--></AD_ELEMENT>
 
+<!--A31D6AEECD6542FB9E08940E7361E1A7--><AD_ELEMENT>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <AD_ELEMENT_ID><![CDATA[A31D6AEECD6542FB9E08940E7361E1A7]]></AD_ELEMENT_ID>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <COLUMNNAME><![CDATA[loggers]]></COLUMNNAME>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <NAME><![CDATA[Loggers]]></NAME>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <PRINTNAME><![CDATA[Loggers]]></PRINTNAME>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--A31D6AEECD6542FB9E08940E7361E1A7-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--A31D6AEECD6542FB9E08940E7361E1A7--></AD_ELEMENT>
+
 <!--A40E05056A904DD8970BFAB4F5AF7E37--><AD_ELEMENT>
 <!--A40E05056A904DD8970BFAB4F5AF7E37-->  <AD_ELEMENT_ID><![CDATA[A40E05056A904DD8970BFAB4F5AF7E37]]></AD_ELEMENT_ID>
 <!--A40E05056A904DD8970BFAB4F5AF7E37-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -877,6 +903,33 @@
 <!--C3D88F4BB67346D49C0E28A676D916AC-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--C3D88F4BB67346D49C0E28A676D916AC--></AD_ELEMENT>
 
+<!--C453BC52FD694241864B69AE2C0F48FB--><AD_ELEMENT>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <AD_ELEMENT_ID><![CDATA[C453BC52FD694241864B69AE2C0F48FB]]></AD_ELEMENT_ID>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <COLUMNNAME><![CDATA[level]]></COLUMNNAME>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <NAME><![CDATA[Log Level]]></NAME>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <PRINTNAME><![CDATA[Log Level]]></PRINTNAME>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <DESCRIPTION><![CDATA[Logger log level]]></DESCRIPTION>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <HELP><![CDATA[Indicates the minimum level events should have for this Logger to process them. By default this level is determined by
+the config files: it is inherited from the root logger unless an specific configuration for this class/package is defined.]]></HELP>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--C453BC52FD694241864B69AE2C0F48FB-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--C453BC52FD694241864B69AE2C0F48FB--></AD_ELEMENT>
+
+<!--C4ED11B624E74BD5B78A9D2960A48B57--><AD_ELEMENT>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <AD_ELEMENT_ID><![CDATA[C4ED11B624E74BD5B78A9D2960A48B57]]></AD_ELEMENT_ID>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <COLUMNNAME><![CDATA[actions]]></COLUMNNAME>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <NAME><![CDATA[Actions]]></NAME>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <PRINTNAME><![CDATA[Actions]]></PRINTNAME>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--C4ED11B624E74BD5B78A9D2960A48B57-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--C4ED11B624E74BD5B78A9D2960A48B57--></AD_ELEMENT>
+
 <!--C8856296F35940AF8E7808DF56118451--><AD_ELEMENT>
 <!--C8856296F35940AF8E7808DF56118451-->  <AD_ELEMENT_ID><![CDATA[C8856296F35940AF8E7808DF56118451]]></AD_ELEMENT_ID>
 <!--C8856296F35940AF8E7808DF56118451-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -946,6 +999,18 @@
 <!--DD25DA6ACBD5424B89E09A93A5D4656C-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--DD25DA6ACBD5424B89E09A93A5D4656C--></AD_ELEMENT>
 
+<!--DD92E8A46BAF43DFA4B02949487DC6CA--><AD_ELEMENT>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <AD_ELEMENT_ID><![CDATA[DD92E8A46BAF43DFA4B02949487DC6CA]]></AD_ELEMENT_ID>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <COLUMNNAME><![CDATA[loglevel]]></COLUMNNAME>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <NAME><![CDATA[Log Level]]></NAME>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <PRINTNAME><![CDATA[Log Level]]></PRINTNAME>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--DD92E8A46BAF43DFA4B02949487DC6CA--></AD_ELEMENT>
+
 <!--E726F553F3C04DE791C8E9C1752227F9--><AD_ELEMENT>
 <!--E726F553F3C04DE791C8E9C1752227F9-->  <AD_ELEMENT_ID><![CDATA[E726F553F3C04DE791C8E9C1752227F9]]></AD_ELEMENT_ID>
 <!--E726F553F3C04DE791C8E9C1752227F9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -2163,6 +2163,34 @@
 <!--2313C95040612193E050007F010068A2-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--2313C95040612193E050007F010068A2--></AD_FIELD>
 
+<!--242318520BF849FCBE9B0B4EAD9464EE--><AD_FIELD>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <AD_FIELD_ID><![CDATA[242318520BF849FCBE9B0B4EAD9464EE]]></AD_FIELD_ID>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <NAME><![CDATA[Logger]]></NAME>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <DESCRIPTION><![CDATA[Logger name]]></DESCRIPTION>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <HELP><![CDATA[Name used to identify a Logger. It usually corresponds to the name of the class being logged, but it can also be named using an arbitrary name.]]></HELP>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <AD_TAB_ID><![CDATA[5E3B722F8CBE4E5BBCEA1F785AC26514]]></AD_TAB_ID>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <AD_COLUMN_ID><![CDATA[555D6DAB70824E5FB990905BEC22EEA7]]></AD_COLUMN_ID>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <DISPLAYLENGTH><![CDATA[200]]></DISPLAYLENGTH>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--242318520BF849FCBE9B0B4EAD9464EE-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--242318520BF849FCBE9B0B4EAD9464EE--></AD_FIELD>
+
 <!--2667CF4C44DB40DAAB0EB19C2B1A864C--><AD_FIELD>
 <!--2667CF4C44DB40DAAB0EB19C2B1A864C-->  <AD_FIELD_ID><![CDATA[2667CF4C44DB40DAAB0EB19C2B1A864C]]></AD_FIELD_ID>
 <!--2667CF4C44DB40DAAB0EB19C2B1A864C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -3531,6 +3559,32 @@
 <!--50FB7470536A44D69F0EB34B18B9D1FB-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--50FB7470536A44D69F0EB34B18B9D1FB--></AD_FIELD>
 
+<!--50FD05116493409D8A41A62CBDB31769--><AD_FIELD>
+<!--50FD05116493409D8A41A62CBDB31769-->  <AD_FIELD_ID><![CDATA[50FD05116493409D8A41A62CBDB31769]]></AD_FIELD_ID>
+<!--50FD05116493409D8A41A62CBDB31769-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--50FD05116493409D8A41A62CBDB31769-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--50FD05116493409D8A41A62CBDB31769-->  <NAME><![CDATA[id]]></NAME>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--50FD05116493409D8A41A62CBDB31769-->  <AD_TAB_ID><![CDATA[5E3B722F8CBE4E5BBCEA1F785AC26514]]></AD_TAB_ID>
+<!--50FD05116493409D8A41A62CBDB31769-->  <AD_COLUMN_ID><![CDATA[AC10D2D19BA34F2384F87DC26F1595B9]]></AD_COLUMN_ID>
+<!--50FD05116493409D8A41A62CBDB31769-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--50FD05116493409D8A41A62CBDB31769-->  <DISPLAYLENGTH><![CDATA[200]]></DISPLAYLENGTH>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--50FD05116493409D8A41A62CBDB31769-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--50FD05116493409D8A41A62CBDB31769-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--50FD05116493409D8A41A62CBDB31769-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--50FD05116493409D8A41A62CBDB31769-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--50FD05116493409D8A41A62CBDB31769-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--50FD05116493409D8A41A62CBDB31769-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--50FD05116493409D8A41A62CBDB31769-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--50FD05116493409D8A41A62CBDB31769--></AD_FIELD>
+
 <!--516959378C7148DDA982C5C655796CBB--><AD_FIELD>
 <!--516959378C7148DDA982C5C655796CBB-->  <AD_FIELD_ID><![CDATA[516959378C7148DDA982C5C655796CBB]]></AD_FIELD_ID>
 <!--516959378C7148DDA982C5C655796CBB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -6956,6 +7010,35 @@
 <!--C01F38E0BD9F431EB6336286E17A433C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--C01F38E0BD9F431EB6336286E17A433C--></AD_FIELD>
 
+<!--C20EC5D0923B4B279882D7F44350C687--><AD_FIELD>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <AD_FIELD_ID><![CDATA[C20EC5D0923B4B279882D7F44350C687]]></AD_FIELD_ID>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <NAME><![CDATA[Log Level]]></NAME>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <DESCRIPTION><![CDATA[Logger log level]]></DESCRIPTION>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <HELP><![CDATA[Indicates the minimum level events should have for this Logger to process them. By default this level is determined by
+the config files: it is inherited from the root logger unless an specific configuration for this class/package is defined.]]></HELP>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <AD_TAB_ID><![CDATA[5E3B722F8CBE4E5BBCEA1F785AC26514]]></AD_TAB_ID>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <AD_COLUMN_ID><![CDATA[780C755C3A81447ABBD830D22038D1CB]]></AD_COLUMN_ID>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C20EC5D0923B4B279882D7F44350C687-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C20EC5D0923B4B279882D7F44350C687--></AD_FIELD>
+
 <!--C216C156DB954876BB6F0B830038E599--><AD_FIELD>
 <!--C216C156DB954876BB6F0B830038E599-->  <AD_FIELD_ID><![CDATA[C216C156DB954876BB6F0B830038E599]]></AD_FIELD_ID>
 <!--C216C156DB954876BB6F0B830038E599-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MENU.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MENU.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -14,6 +14,21 @@
 <!--53A93D1C7EB84409B05847A8691FA9AB-->  <OPENLINKINBROWSER><![CDATA[N]]></OPENLINKINBROWSER>
 <!--53A93D1C7EB84409B05847A8691FA9AB--></AD_MENU>
 
+<!--6011C7160F164247B4AEE7E45D466442--><AD_MENU>
+<!--6011C7160F164247B4AEE7E45D466442-->  <AD_MENU_ID><![CDATA[6011C7160F164247B4AEE7E45D466442]]></AD_MENU_ID>
+<!--6011C7160F164247B4AEE7E45D466442-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6011C7160F164247B4AEE7E45D466442-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6011C7160F164247B4AEE7E45D466442-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6011C7160F164247B4AEE7E45D466442-->  <NAME><![CDATA[Log Management]]></NAME>
+<!--6011C7160F164247B4AEE7E45D466442-->  <DESCRIPTION><![CDATA[Manage active Loggers]]></DESCRIPTION>
+<!--6011C7160F164247B4AEE7E45D466442-->  <ISSUMMARY><![CDATA[N]]></ISSUMMARY>
+<!--6011C7160F164247B4AEE7E45D466442-->  <ACTION><![CDATA[OBUIAPP_Process]]></ACTION>
+<!--6011C7160F164247B4AEE7E45D466442-->  <AD_WINDOW_ID><![CDATA[DCA855BFACF94A8CAB1F66E825D9076B]]></AD_WINDOW_ID>
+<!--6011C7160F164247B4AEE7E45D466442-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--6011C7160F164247B4AEE7E45D466442-->  <OPENLINKINBROWSER><![CDATA[N]]></OPENLINKINBROWSER>
+<!--6011C7160F164247B4AEE7E45D466442-->  <EM_OBUIAPP_PROCESS_ID><![CDATA[FF1893F761AF46E893E37CB4EF1DFCB1]]></EM_OBUIAPP_PROCESS_ID>
+<!--6011C7160F164247B4AEE7E45D466442--></AD_MENU>
+
 <!--6FD97ECD72B4405FA1442FD8673AE571--><AD_MENU>
 <!--6FD97ECD72B4405FA1442FD8673AE571-->  <AD_MENU_ID><![CDATA[6FD97ECD72B4405FA1442FD8673AE571]]></AD_MENU_ID>
 <!--6FD97ECD72B4405FA1442FD8673AE571-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -482,6 +482,18 @@
 <!--2C8A8843F1E04317AD38623A3C52F978-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--2C8A8843F1E04317AD38623A3C52F978--></AD_MESSAGE>
 
+<!--2E7A7ADA901742CE935C04E1861A0988--><AD_MESSAGE>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <AD_MESSAGE_ID><![CDATA[2E7A7ADA901742CE935C04E1861A0988]]></AD_MESSAGE_ID>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <VALUE><![CDATA[OBUIAPP_LogLevelChanged]]></VALUE>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <MSGTEXT><![CDATA[Log Level changed for the selected entries]]></MSGTEXT>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <MSGTYPE><![CDATA[S]]></MSGTYPE>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--2E7A7ADA901742CE935C04E1861A0988-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--2E7A7ADA901742CE935C04E1861A0988--></AD_MESSAGE>
+
 <!--2EEFD14AC47C4C2ABB4218DFB2F12564--><AD_MESSAGE>
 <!--2EEFD14AC47C4C2ABB4218DFB2F12564-->  <AD_MESSAGE_ID><![CDATA[2EEFD14AC47C4C2ABB4218DFB2F12564]]></AD_MESSAGE_ID>
 <!--2EEFD14AC47C4C2ABB4218DFB2F12564-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -44,6 +44,18 @@
 <!--1AC7885279E44C4F976267C28270E1F9-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--1AC7885279E44C4F976267C28270E1F9--></AD_REFERENCE>
 
+<!--796D78C416C042DB8BF4D2FE64A7E95E--><AD_REFERENCE>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <AD_REFERENCE_ID><![CDATA[796D78C416C042DB8BF4D2FE64A7E95E]]></AD_REFERENCE_ID>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <NAME><![CDATA[OBUIAPP_LogManagementButtonList]]></NAME>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <PARENTREFERENCE_ID><![CDATA[FF80818132F94B500132F9575619000A]]></PARENTREFERENCE_ID>
+<!--796D78C416C042DB8BF4D2FE64A7E95E-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--796D78C416C042DB8BF4D2FE64A7E95E--></AD_REFERENCE>
+
 <!--892231CFE03848758D74B0209B801C14--><AD_REFERENCE>
 <!--892231CFE03848758D74B0209B801C14-->  <AD_REFERENCE_ID><![CDATA[892231CFE03848758D74B0209B801C14]]></AD_REFERENCE_ID>
 <!--892231CFE03848758D74B0209B801C14-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -82,6 +94,19 @@
 <!--BCDF0DC3ECD14B07AC54287DCB1276D2-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--BCDF0DC3ECD14B07AC54287DCB1276D2--></AD_REFERENCE>
 
+<!--BEB937C8808C4EFA977887CADDAC4E07--><AD_REFERENCE>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <AD_REFERENCE_ID><![CDATA[BEB937C8808C4EFA977887CADDAC4E07]]></AD_REFERENCE_ID>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <NAME><![CDATA[Loggers]]></NAME>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <DESCRIPTION><![CDATA[Active loggers window]]></DESCRIPTION>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <PARENTREFERENCE_ID><![CDATA[FF80818132D8F0F30132D9BC395D0038]]></PARENTREFERENCE_ID>
+<!--BEB937C8808C4EFA977887CADDAC4E07-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--BEB937C8808C4EFA977887CADDAC4E07--></AD_REFERENCE>
+
 <!--BF6302EFCC854FA3B75658737442CEC9--><AD_REFERENCE>
 <!--BF6302EFCC854FA3B75658737442CEC9-->  <AD_REFERENCE_ID><![CDATA[BF6302EFCC854FA3B75658737442CEC9]]></AD_REFERENCE_ID>
 <!--BF6302EFCC854FA3B75658737442CEC9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -96,6 +121,20 @@
 <!--BF6302EFCC854FA3B75658737442CEC9-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--BF6302EFCC854FA3B75658737442CEC9--></AD_REFERENCE>
 
+<!--CF8CB8C4E798423081CE42078CA6BD7C--><AD_REFERENCE>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <NAME><![CDATA[Log Level]]></NAME>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <DESCRIPTION><![CDATA[Log levels supported by logger]]></DESCRIPTION>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <HELP><![CDATA[Contains all log levels supported by the logging library]]></HELP>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--CF8CB8C4E798423081CE42078CA6BD7C-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--CF8CB8C4E798423081CE42078CA6BD7C--></AD_REFERENCE>
+
 <!--D6193AA7FAB6429C8F34249FBF5A5F50--><AD_REFERENCE>
 <!--D6193AA7FAB6429C8F34249FBF5A5F50-->  <AD_REFERENCE_ID><![CDATA[D6193AA7FAB6429C8F34249FBF5A5F50]]></AD_REFERENCE_ID>
 <!--D6193AA7FAB6429C8F34249FBF5A5F50-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -47,6 +47,18 @@
 <!--18ECDF9EC67E405BBEA050F45BA8D0CD-->  <SEQNO><![CDATA[40]]></SEQNO>
 <!--18ECDF9EC67E405BBEA050F45BA8D0CD--></AD_REF_LIST>
 
+<!--1D1B003A749F412D88EF43BA5AF9C743--><AD_REF_LIST>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <AD_REF_LIST_ID><![CDATA[1D1B003A749F412D88EF43BA5AF9C743]]></AD_REF_LIST_ID>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <VALUE><![CDATA[FATAL]]></VALUE>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <NAME><![CDATA[FATAL]]></NAME>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--1D1B003A749F412D88EF43BA5AF9C743-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--1D1B003A749F412D88EF43BA5AF9C743--></AD_REF_LIST>
+
 <!--1E1929CEE0024199A910E33A61678F60--><AD_REF_LIST>
 <!--1E1929CEE0024199A910E33A61678F60-->  <AD_REF_LIST_ID><![CDATA[1E1929CEE0024199A910E33A61678F60]]></AD_REF_LIST_ID>
 <!--1E1929CEE0024199A910E33A61678F60-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -92,6 +104,19 @@
 <!--3A347A8CAF7347B1A7097634F7559011-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--3A347A8CAF7347B1A7097634F7559011--></AD_REF_LIST>
 
+<!--3B90BB8348CD4F64980355F35204FF22--><AD_REF_LIST>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <AD_REF_LIST_ID><![CDATA[3B90BB8348CD4F64980355F35204FF22]]></AD_REF_LIST_ID>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <VALUE><![CDATA[OFF]]></VALUE>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <NAME><![CDATA[OFF]]></NAME>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <DESCRIPTION><![CDATA[Logger is off. No log will be shown for this logger]]></DESCRIPTION>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--3B90BB8348CD4F64980355F35204FF22-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--3B90BB8348CD4F64980355F35204FF22--></AD_REF_LIST>
+
 <!--3D9CA94C564A46A6A0C4E4B31CDC20F9--><AD_REF_LIST>
 <!--3D9CA94C564A46A6A0C4E4B31CDC20F9-->  <AD_REF_LIST_ID><![CDATA[3D9CA94C564A46A6A0C4E4B31CDC20F9]]></AD_REF_LIST_ID>
 <!--3D9CA94C564A46A6A0C4E4B31CDC20F9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -140,6 +165,18 @@
 <!--4C0466BB94BD413BB8D523C3FADB4E4C-->  <SEQNO><![CDATA[60]]></SEQNO>
 <!--4C0466BB94BD413BB8D523C3FADB4E4C--></AD_REF_LIST>
 
+<!--54970D90B5F14AA48756C3CE1FE30994--><AD_REF_LIST>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <AD_REF_LIST_ID><![CDATA[54970D90B5F14AA48756C3CE1FE30994]]></AD_REF_LIST_ID>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <VALUE><![CDATA[ERROR]]></VALUE>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <NAME><![CDATA[ERROR]]></NAME>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--54970D90B5F14AA48756C3CE1FE30994-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--54970D90B5F14AA48756C3CE1FE30994--></AD_REF_LIST>
+
 <!--557BFB777B164892BB8BC97772EEA71A--><AD_REF_LIST>
 <!--557BFB777B164892BB8BC97772EEA71A-->  <AD_REF_LIST_ID><![CDATA[557BFB777B164892BB8BC97772EEA71A]]></AD_REF_LIST_ID>
 <!--557BFB777B164892BB8BC97772EEA71A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -175,6 +212,18 @@
 <!--67C9AE863A644F46BC21F563E4910F6C-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--67C9AE863A644F46BC21F563E4910F6C--></AD_REF_LIST>
 
+<!--690FF92F61234B8B8A18EA60FD7C8C4A--><AD_REF_LIST>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <AD_REF_LIST_ID><![CDATA[690FF92F61234B8B8A18EA60FD7C8C4A]]></AD_REF_LIST_ID>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <VALUE><![CDATA[DEBUG]]></VALUE>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <NAME><![CDATA[DEBUG]]></NAME>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--690FF92F61234B8B8A18EA60FD7C8C4A--></AD_REF_LIST>
+
 <!--6D7755B77E254D83AAC62B93D3A62ED9--><AD_REF_LIST>
 <!--6D7755B77E254D83AAC62B93D3A62ED9-->  <AD_REF_LIST_ID><![CDATA[6D7755B77E254D83AAC62B93D3A62ED9]]></AD_REF_LIST_ID>
 <!--6D7755B77E254D83AAC62B93D3A62ED9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -223,6 +272,18 @@
 <!--7BA6CC6144AC411BA76447FBECFD801C-->  <SEQNO><![CDATA[10]]></SEQNO>
 <!--7BA6CC6144AC411BA76447FBECFD801C--></AD_REF_LIST>
 
+<!--7C65C327A4B141CF9E20C82A7393C1C2--><AD_REF_LIST>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <AD_REF_LIST_ID><![CDATA[7C65C327A4B141CF9E20C82A7393C1C2]]></AD_REF_LIST_ID>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <VALUE><![CDATA[INFO]]></VALUE>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <NAME><![CDATA[INFO]]></NAME>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--7C65C327A4B141CF9E20C82A7393C1C2-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--7C65C327A4B141CF9E20C82A7393C1C2--></AD_REF_LIST>
+
 <!--7ED34AAD4A1746FBAF149C03BCBF53B7--><AD_REF_LIST>
 <!--7ED34AAD4A1746FBAF149C03BCBF53B7-->  <AD_REF_LIST_ID><![CDATA[7ED34AAD4A1746FBAF149C03BCBF53B7]]></AD_REF_LIST_ID>
 <!--7ED34AAD4A1746FBAF149C03BCBF53B7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -363,6 +424,18 @@
 <!--BFCEC56FA0014475BC33E1E0CA310A15-->  <SEQNO><![CDATA[20]]></SEQNO>
 <!--BFCEC56FA0014475BC33E1E0CA310A15--></AD_REF_LIST>
 
+<!--C0E1AAAEB441463FA3FF6AF64C946D15--><AD_REF_LIST>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <AD_REF_LIST_ID><![CDATA[C0E1AAAEB441463FA3FF6AF64C946D15]]></AD_REF_LIST_ID>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <VALUE><![CDATA[TRACE]]></VALUE>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <NAME><![CDATA[TRACE]]></NAME>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--C0E1AAAEB441463FA3FF6AF64C946D15--></AD_REF_LIST>
+
 <!--C1990DC063B94C7EBCA8402777A9B4DC--><AD_REF_LIST>
 <!--C1990DC063B94C7EBCA8402777A9B4DC-->  <AD_REF_LIST_ID><![CDATA[C1990DC063B94C7EBCA8402777A9B4DC]]></AD_REF_LIST_ID>
 <!--C1990DC063B94C7EBCA8402777A9B4DC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -375,6 +448,18 @@
 <!--C1990DC063B94C7EBCA8402777A9B4DC-->  <SEQNO><![CDATA[60]]></SEQNO>
 <!--C1990DC063B94C7EBCA8402777A9B4DC--></AD_REF_LIST>
 
+<!--C2B98F5FB8D849D78D26A34103E44D1A--><AD_REF_LIST>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <AD_REF_LIST_ID><![CDATA[C2B98F5FB8D849D78D26A34103E44D1A]]></AD_REF_LIST_ID>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <VALUE><![CDATA[WARN]]></VALUE>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <NAME><![CDATA[WARNING]]></NAME>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--C2B98F5FB8D849D78D26A34103E44D1A-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--C2B98F5FB8D849D78D26A34103E44D1A--></AD_REF_LIST>
+
 <!--C305601E197949A5A07257C701CFA04C--><AD_REF_LIST>
 <!--C305601E197949A5A07257C701CFA04C-->  <AD_REF_LIST_ID><![CDATA[C305601E197949A5A07257C701CFA04C]]></AD_REF_LIST_ID>
 <!--C305601E197949A5A07257C701CFA04C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -423,6 +508,31 @@
 <!--CA687B03F0984309BAF3E7592C0AE77C-->  <SEQNO><![CDATA[30]]></SEQNO>
 <!--CA687B03F0984309BAF3E7592C0AE77C--></AD_REF_LIST>
 
+<!--D7700C87728241AC8FB79D85DD3E1B14--><AD_REF_LIST>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <AD_REF_LIST_ID><![CDATA[D7700C87728241AC8FB79D85DD3E1B14]]></AD_REF_LIST_ID>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <VALUE><![CDATA[apply]]></VALUE>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <NAME><![CDATA[Apply]]></NAME>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <AD_REFERENCE_ID><![CDATA[796D78C416C042DB8BF4D2FE64A7E95E]]></AD_REFERENCE_ID>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--D7700C87728241AC8FB79D85DD3E1B14-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--D7700C87728241AC8FB79D85DD3E1B14--></AD_REF_LIST>
+
+<!--E229E56F4A3E4677B5F5FBED9D7E5876--><AD_REF_LIST>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <AD_REF_LIST_ID><![CDATA[E229E56F4A3E4677B5F5FBED9D7E5876]]></AD_REF_LIST_ID>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <VALUE><![CDATA[ALL]]></VALUE>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <NAME><![CDATA[ALL]]></NAME>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <DESCRIPTION><![CDATA[All logs will be shown regardless of its level]]></DESCRIPTION>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <AD_REFERENCE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_ID>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--E229E56F4A3E4677B5F5FBED9D7E5876--></AD_REF_LIST>
+
 <!--E53EC9857A5042E3A7C3534AA8F642DD--><AD_REF_LIST>
 <!--E53EC9857A5042E3A7C3534AA8F642DD-->  <AD_REF_LIST_ID><![CDATA[E53EC9857A5042E3A7C3534AA8F642DD]]></AD_REF_LIST_ID>
 <!--E53EC9857A5042E3A7C3534AA8F642DD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_TAB.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_TAB.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -153,6 +153,37 @@
 <!--4F5C5D438DAF47D4AE8DD48C44D4FE04-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
 <!--4F5C5D438DAF47D4AE8DD48C44D4FE04--></AD_TAB>
 
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514--><AD_TAB>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <AD_TAB_ID><![CDATA[5E3B722F8CBE4E5BBCEA1F785AC26514]]></AD_TAB_ID>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <NAME><![CDATA[Header]]></NAME>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <DESCRIPTION><![CDATA[List available Loggers]]></DESCRIPTION>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <HELP><![CDATA[List available Loggers]]></HELP>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <AD_TABLE_ID><![CDATA[ED87AD8D00DE4CC79B9BB66F3E90B78B]]></AD_TABLE_ID>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <AD_WINDOW_ID><![CDATA[DCA855BFACF94A8CAB1F66E825D9076B]]></AD_WINDOW_ID>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <TABLEVEL><![CDATA[0]]></TABLEVEL>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <ISTRANSLATIONTAB><![CDATA[N]]></ISTRANSLATIONTAB>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <HASTREE><![CDATA[N]]></HASTREE>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <ISREADONLYTREE><![CDATA[N]]></ISREADONLYTREE>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <ISSHOWTREENODEICONS><![CDATA[Y]]></ISSHOWTREENODEICONS>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <EM_OBUIAPP_CAN_ADD><![CDATA[N]]></EM_OBUIAPP_CAN_ADD>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <EM_OBUIAPP_CAN_DELETE><![CDATA[N]]></EM_OBUIAPP_CAN_DELETE>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
+<!--5E3B722F8CBE4E5BBCEA1F785AC26514--></AD_TAB>
+
 <!--6D732D027FFA4FB1BD0140ED3B606C0E--><AD_TAB>
 <!--6D732D027FFA4FB1BD0140ED3B606C0E-->  <AD_TAB_ID><![CDATA[6D732D027FFA4FB1BD0140ED3B606C0E]]></AD_TAB_ID>
 <!--6D732D027FFA4FB1BD0140ED3B606C0E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_TABLE.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_TABLE.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -360,6 +360,30 @@
 <!--E6F29F8A30BC4603B1D1195051C4F3A6-->  <ISTREE><![CDATA[N]]></ISTREE>
 <!--E6F29F8A30BC4603B1D1195051C4F3A6--></AD_TABLE>
 
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B--><AD_TABLE>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <AD_TABLE_ID><![CDATA[ED87AD8D00DE4CC79B9BB66F3E90B78B]]></AD_TABLE_ID>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <NAME><![CDATA[OBUIAPP_LoggerManagement]]></NAME>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <DESCRIPTION><![CDATA[Logger log level management]]></DESCRIPTION>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <HELP><![CDATA[Shows all registered Loggers and their assigned log level based on the current configuration.]]></HELP>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <TABLENAME><![CDATA[OBUIAPP_LoggerManagement]]></TABLENAME>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ISVIEW><![CDATA[N]]></ISVIEW>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ACCESSLEVEL><![CDATA[4]]></ACCESSLEVEL>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ISSECURITYENABLED><![CDATA[N]]></ISSECURITYENABLED>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ISDELETEABLE><![CDATA[Y]]></ISDELETEABLE>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ISHIGHVOLUME><![CDATA[N]]></ISHIGHVOLUME>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <IMPORTTABLE><![CDATA[N]]></IMPORTTABLE>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ISCHANGELOG><![CDATA[N]]></ISCHANGELOG>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <AD_PACKAGE_ID><![CDATA[BA250A68426F4D71BACAE830EF4EC696]]></AD_PACKAGE_ID>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <DATAORIGINTYPE><![CDATA[Datasource]]></DATAORIGINTYPE>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <OBSERDS_DATASOURCE_ID><![CDATA[F6DCA62BC0694DACA9CC84748C119FC5]]></OBSERDS_DATASOURCE_ID>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B-->  <ISTREE><![CDATA[N]]></ISTREE>
+<!--ED87AD8D00DE4CC79B9BB66F3E90B78B--></AD_TABLE>
+
 <!--F167EB822B8A4284AC37D5B40B785D51--><AD_TABLE>
 <!--F167EB822B8A4284AC37D5B40B785D51-->  <AD_TABLE_ID><![CDATA[F167EB822B8A4284AC37D5B40B785D51]]></AD_TABLE_ID>
 <!--F167EB822B8A4284AC37D5B40B785D51-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_TREENODE.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_TREENODE.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -22,6 +22,17 @@
 <!--258D19F188E94196936EF06CF608664C-->  <SEQNO><![CDATA[40]]></SEQNO>
 <!--258D19F188E94196936EF06CF608664C--></AD_TREENODE>
 
+<!--58165452E5B64A4DAC6D22D624D8117B--><AD_TREENODE>
+<!--58165452E5B64A4DAC6D22D624D8117B-->  <AD_TREENODE_ID><![CDATA[58165452E5B64A4DAC6D22D624D8117B]]></AD_TREENODE_ID>
+<!--58165452E5B64A4DAC6D22D624D8117B-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
+<!--58165452E5B64A4DAC6D22D624D8117B-->  <NODE_ID><![CDATA[6011C7160F164247B4AEE7E45D466442]]></NODE_ID>
+<!--58165452E5B64A4DAC6D22D624D8117B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--58165452E5B64A4DAC6D22D624D8117B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--58165452E5B64A4DAC6D22D624D8117B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--58165452E5B64A4DAC6D22D624D8117B-->  <PARENT_ID><![CDATA[161]]></PARENT_ID>
+<!--58165452E5B64A4DAC6D22D624D8117B-->  <SEQNO><![CDATA[180]]></SEQNO>
+<!--58165452E5B64A4DAC6D22D624D8117B--></AD_TREENODE>
+
 <!--76DC645312694D7A8E686BF48C3B490C--><AD_TREENODE>
 <!--76DC645312694D7A8E686BF48C3B490C-->  <AD_TREENODE_ID><![CDATA[76DC645312694D7A8E686BF48C3B490C]]></AD_TREENODE_ID>
 <!--76DC645312694D7A8E686BF48C3B490C-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
@@ -63,7 +74,7 @@
 <!--B83877C5FBFF4DF495E4A2F4DE15E2D1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--B83877C5FBFF4DF495E4A2F4DE15E2D1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--B83877C5FBFF4DF495E4A2F4DE15E2D1-->  <PARENT_ID><![CDATA[161]]></PARENT_ID>
-<!--B83877C5FBFF4DF495E4A2F4DE15E2D1-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--B83877C5FBFF4DF495E4A2F4DE15E2D1-->  <SEQNO><![CDATA[20]]></SEQNO>
 <!--B83877C5FBFF4DF495E4A2F4DE15E2D1--></AD_TREENODE>
 
 <!--CDB4E2EADAAA4C63946C2EC2D8031CAF--><AD_TREENODE>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_WINDOW.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_WINDOW.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -51,6 +51,23 @@
 <!--7E72F3A16C704449BC50FCE1512C3805-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--7E72F3A16C704449BC50FCE1512C3805--></AD_WINDOW>
 
+<!--DCA855BFACF94A8CAB1F66E825D9076B--><AD_WINDOW>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <AD_WINDOW_ID><![CDATA[DCA855BFACF94A8CAB1F66E825D9076B]]></AD_WINDOW_ID>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <NAME><![CDATA[Log Management]]></NAME>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <DESCRIPTION><![CDATA[Manage active Loggers]]></DESCRIPTION>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <HELP><![CDATA[Shows all registered Loggers and let change the log level of one or more loggers.]]></HELP>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <WINDOWTYPE><![CDATA[OBUIAPP_PickAndExecute]]></WINDOWTYPE>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <ISSOTRX><![CDATA[N]]></ISSOTRX>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <ISTHREADSAFE><![CDATA[N]]></ISTHREADSAFE>
+<!--DCA855BFACF94A8CAB1F66E825D9076B-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--DCA855BFACF94A8CAB1F66E825D9076B--></AD_WINDOW>
+
 <!--EBA40241D46D4FA4A24E4A09C61994AA--><AD_WINDOW>
 <!--EBA40241D46D4FA4A24E4A09C61994AA-->  <AD_WINDOW_ID><![CDATA[EBA40241D46D4FA4A24E4A09C61994AA]]></AD_WINDOW_ID>
 <!--EBA40241D46D4FA4A24E4A09C61994AA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/OBSERDS_DATASOURCE.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/OBSERDS_DATASOURCE.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -41,4 +41,18 @@
 <!--DB9F062472294F12A0291A7BD203F922-->  <IDFKFILTERING><![CDATA[Y]]></IDFKFILTERING>
 <!--DB9F062472294F12A0291A7BD203F922--></OBSERDS_DATASOURCE>
 
+<!--F6DCA62BC0694DACA9CC84748C119FC5--><OBSERDS_DATASOURCE>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <OBSERDS_DATASOURCE_ID><![CDATA[F6DCA62BC0694DACA9CC84748C119FC5]]></OBSERDS_DATASOURCE_ID>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <NAME><![CDATA[Log Management Datasource]]></NAME>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <DESCRIPTION><![CDATA[Datasource that shows all classes that have a logger configured]]></DESCRIPTION>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <CLASSNAME><![CDATA[org.openbravo.client.application.logmanagement.LogDatasource]]></CLASSNAME>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <OBCLKER_TEMPLATE_ID><![CDATA[2BAD445C2A0343C58E455F9BD379C690]]></OBCLKER_TEMPLATE_ID>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <USEASTABLEDATAORIGIN><![CDATA[Y]]></USEASTABLEDATAORIGIN>
+<!--F6DCA62BC0694DACA9CC84748C119FC5-->  <IDFKFILTERING><![CDATA[N]]></IDFKFILTERING>
+<!--F6DCA62BC0694DACA9CC84748C119FC5--></OBSERDS_DATASOURCE>
+
 </data>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,76 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<data>
+<!--4AE8686060B7439A8EE170BFB3FA078B--><OBUIAPP_PARAMETER>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <OBUIAPP_PARAMETER_ID><![CDATA[4AE8686060B7439A8EE170BFB3FA078B]]></OBUIAPP_PARAMETER_ID>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <NAME><![CDATA[Log Level]]></NAME>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <AD_REFERENCE_VALUE_ID><![CDATA[CF8CB8C4E798423081CE42078CA6BD7C]]></AD_REFERENCE_VALUE_ID>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <COLUMNNAME><![CDATA[loglevel]]></COLUMNNAME>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <DEFAULTVALUE><![CDATA["INFO"]]></DEFAULTVALUE>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <AD_ELEMENT_ID><![CDATA[DD92E8A46BAF43DFA4B02949487DC6CA]]></AD_ELEMENT_ID>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <OBUIAPP_PROCESS_ID><![CDATA[FF1893F761AF46E893E37CB4EF1DFCB1]]></OBUIAPP_PROCESS_ID>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <STARTINNEWLINE><![CDATA[N]]></STARTINNEWLINE>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--4AE8686060B7439A8EE170BFB3FA078B-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--4AE8686060B7439A8EE170BFB3FA078B--></OBUIAPP_PARAMETER>
+
+<!--C8A1D70CDE4A4500873C85A419CFE0B7--><OBUIAPP_PARAMETER>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <OBUIAPP_PARAMETER_ID><![CDATA[C8A1D70CDE4A4500873C85A419CFE0B7]]></OBUIAPP_PARAMETER_ID>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <NAME><![CDATA[Loggers]]></NAME>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <AD_REFERENCE_ID><![CDATA[FF80818132D8F0F30132D9BC395D0038]]></AD_REFERENCE_ID>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <AD_REFERENCE_VALUE_ID><![CDATA[BEB937C8808C4EFA977887CADDAC4E07]]></AD_REFERENCE_VALUE_ID>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <COLUMNNAME><![CDATA[loggers]]></COLUMNNAME>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <AD_ELEMENT_ID><![CDATA[A31D6AEECD6542FB9E08940E7361E1A7]]></AD_ELEMENT_ID>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <OBUIAPP_PROCESS_ID><![CDATA[FF1893F761AF46E893E37CB4EF1DFCB1]]></OBUIAPP_PROCESS_ID>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <STARTINNEWLINE><![CDATA[N]]></STARTINNEWLINE>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <DISPLAYEDROWS><![CDATA[15]]></DISPLAYEDROWS>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--C8A1D70CDE4A4500873C85A419CFE0B7--></OBUIAPP_PARAMETER>
+
+<!--CE1CE26CDB9241B3B036C47013226501--><OBUIAPP_PARAMETER>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <OBUIAPP_PARAMETER_ID><![CDATA[CE1CE26CDB9241B3B036C47013226501]]></OBUIAPP_PARAMETER_ID>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <NAME><![CDATA[Actions]]></NAME>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <AD_REFERENCE_ID><![CDATA[FF80818132F94B500132F9575619000A]]></AD_REFERENCE_ID>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <AD_REFERENCE_VALUE_ID><![CDATA[796D78C416C042DB8BF4D2FE64A7E95E]]></AD_REFERENCE_VALUE_ID>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <COLUMNNAME><![CDATA[actions]]></COLUMNNAME>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <AD_ELEMENT_ID><![CDATA[C4ED11B624E74BD5B78A9D2960A48B57]]></AD_ELEMENT_ID>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <OBUIAPP_PROCESS_ID><![CDATA[FF1893F761AF46E893E37CB4EF1DFCB1]]></OBUIAPP_PROCESS_ID>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <STARTINNEWLINE><![CDATA[N]]></STARTINNEWLINE>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--CE1CE26CDB9241B3B036C47013226501-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--CE1CE26CDB9241B3B036C47013226501--></OBUIAPP_PARAMETER>
+
+</data>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<data>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1--><OBUIAPP_PROCESS>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <OBUIAPP_PROCESS_ID><![CDATA[FF1893F761AF46E893E37CB4EF1DFCB1]]></OBUIAPP_PROCESS_ID>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <VALUE><![CDATA[LogManagement]]></VALUE>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <NAME><![CDATA[Log Management]]></NAME>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <DESCRIPTION><![CDATA[Update the log level of the given Loggers]]></DESCRIPTION>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <HELP><![CDATA[This action updates the log level of the given loggers, overwriting their default configuration. Note that this changes will be reverted if Tomcat is restarted so consider editing the log4j config files if changes are meant to be permanent.]]></HELP>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <ACCESSLEVEL><![CDATA[4]]></ACCESSLEVEL>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <CLASSNAME><![CDATA[org.openbravo.client.application.logmanagement.LogManagementActionHandler]]></CLASSNAME>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <UIPATTERN><![CDATA[OBUIAPP_PickAndExecute]]></UIPATTERN>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <ISMULTIRECORD><![CDATA[Y]]></ISMULTIRECORD>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <ISGRIDLEGACY><![CDATA[N]]></ISGRIDLEGACY>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
+<!--FF1893F761AF46E893E37CB4EF1DFCB1--></OBUIAPP_PROCESS>
+
+</data>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/OBUIAPP_REF_WINDOW.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<data>
+<!--517600D185E04A3CBBB9BDA7C86A6500--><OBUIAPP_REF_WINDOW>
+<!--517600D185E04A3CBBB9BDA7C86A6500-->  <OBUIAPP_REF_WINDOW_ID><![CDATA[517600D185E04A3CBBB9BDA7C86A6500]]></OBUIAPP_REF_WINDOW_ID>
+<!--517600D185E04A3CBBB9BDA7C86A6500-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--517600D185E04A3CBBB9BDA7C86A6500-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--517600D185E04A3CBBB9BDA7C86A6500-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--517600D185E04A3CBBB9BDA7C86A6500-->  <AD_REFERENCE_ID><![CDATA[BEB937C8808C4EFA977887CADDAC4E07]]></AD_REFERENCE_ID>
+<!--517600D185E04A3CBBB9BDA7C86A6500-->  <AD_WINDOW_ID><![CDATA[DCA855BFACF94A8CAB1F66E825D9076B]]></AD_WINDOW_ID>
+<!--517600D185E04A3CBBB9BDA7C86A6500--></OBUIAPP_REF_WINDOW>
+
+</data>
--- a/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/ADCSInitialization.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/ADCSInitialization.java	Tue Dec 11 12:26:44 2018 +0000
@@ -42,8 +42,8 @@
 import org.openbravo.model.ad.ui.Field;
 import org.openbravo.model.ad.utility.AttachmentMethod;
 import org.openbravo.test.base.mock.HttpServletRequestMock;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Test cases to ensure correct concurrent initialization of ADCS.
@@ -52,7 +52,7 @@
  *
  */
 public class ADCSInitialization extends WeldBaseTest {
-  private static final Logger log = LoggerFactory.getLogger(ADCSInitialization.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   ApplicationDictionaryCachedStructures adcs;
--- a/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/GenerateTypesJSTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/GenerateTypesJSTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -30,8 +30,8 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.userinterface.smartclient.SmartClientComponentProvider;
 import org.openbravo.userinterface.smartclient.TypesComponent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Test the {@link TypesComponent} and its template.
@@ -39,7 +39,7 @@
  * @author mtaal
  */
 public class GenerateTypesJSTest extends WeldBaseTest {
-  private static final Logger log = LoggerFactory.getLogger(GenerateTypesJSTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   @ComponentProvider.Qualifier(SmartClientComponentProvider.QUALIFIER)
--- a/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/MenuTemplateTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/MenuTemplateTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -27,8 +27,8 @@
 import org.openbravo.client.application.MainLayoutComponent;
 import org.openbravo.client.kernel.JSCompressor;
 import org.openbravo.client.kernel.JSLintChecker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Tests the generating of the menu through a template, menu is part of the MainLayoutComponent, so
@@ -37,7 +37,7 @@
  * @author mtaal
  */
 public class MenuTemplateTest extends WeldBaseTest {
-  private static final Logger log = LoggerFactory.getLogger(MenuTemplateTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   private MainLayoutComponent mainLayoutComponent;
--- a/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/MenuTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/MenuTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -26,8 +26,8 @@
 import org.openbravo.base.weld.test.WeldBaseTest;
 import org.openbravo.client.application.MenuManager;
 import org.openbravo.client.application.MenuManager.MenuOption;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Tests the reading of the menu in memory
@@ -35,7 +35,7 @@
  * @author iperdomo
  */
 public class MenuTest extends WeldBaseTest {
-  private static final Logger log = LoggerFactory.getLogger(MenuTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   private MenuManager menuManager;
--- a/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/StandardWindowTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/StandardWindowTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2010-2017 Openbravo SLU
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -24,7 +24,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Level;
+import org.apache.logging.log4j.Level;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.openbravo.base.weld.test.WeldBaseTest;
@@ -35,8 +35,8 @@
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
 import org.openbravo.test.base.mock.HttpServletRequestMock;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Tests generation of the javascript for standard windows
@@ -44,7 +44,7 @@
  * @author iperdomo
  */
 public class StandardWindowTest extends WeldBaseTest {
-  private static final Logger log = LoggerFactory.getLogger(StandardWindowTest.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String USER_INTERFACE_APP_MOD = "9BA0836A3CD74EE4AB48753A47211BCC";
 
   /**
@@ -71,7 +71,7 @@
       List<String> errors = new ArrayList<>();
       for (Window window : allWindows) {
         if (hasAtLeastOneActiveTab(window)) {
-          log.info("window {} of {}: {}", new Object[] { ++i, allWindows.size(), window.getName() });
+          log.info("window {} of {}: {}", ++i, allWindows.size(), window.getName());
           try {
             generateForWindow(window);
           } catch (Throwable t) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ADAlertDatasourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ADAlertDatasourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -40,8 +40,8 @@
 import org.openbravo.erpCommon.utility.UsedByLink;
 import org.openbravo.service.datasource.DefaultDataSourceService;
 import org.openbravo.service.json.JsonConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Datasource used by the Alert Management window
@@ -52,7 +52,7 @@
   private static final String ALERT_RULE_TAB = "alertRule.tab.id";
   private static final int ALERT_RULE_ID = 0;
   private static final int ALERT_RULE_FILTERCLAUSE = 1;
-  private static final Logger log = LoggerFactory.getLogger(ADAlertDatasourceService.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   public Entity getEntity() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -35,7 +35,8 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.query.Query;
@@ -62,7 +63,7 @@
  */
 @ApplicationScoped
 public class AlertActionHandler extends BaseActionHandler implements PortalAccessible {
-  private static final Logger log4j = Logger.getLogger(AlertActionHandler.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   /*
    * (non-Javadoc)
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertManagementActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertManagementActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -31,8 +31,8 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
 import org.openbravo.model.ad.alert.Alert;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * @author gorkaion
@@ -40,7 +40,7 @@
  */
 @ApplicationScoped
 public class AlertManagementActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory.getLogger(AlertManagementActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String MOVE_TO_STATUS = "moveToStatus";
 
   /*
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -45,7 +46,7 @@
  */
 public class ApplicationUtils {
 
-  private static Logger log = Logger.getLogger(ApplicationUtils.class);
+  private static Logger log = LogManager.getLogger();
   private static final String BUTTON_REFERENCE = "28";
 
   /**
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/CachedPreference.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/CachedPreference.java	Tue Dec 11 12:26:44 2018 +0000
@@ -33,8 +33,8 @@
 import org.openbravo.erpCommon.utility.PropertyException;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.common.enterprise.Organization;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This class is used to keep the value of some preferences in cache during the life cycle of a
@@ -46,7 +46,7 @@
 public class CachedPreference implements Serializable {
 
   private static final long serialVersionUID = 1L;
-  private static final Logger log = LoggerFactory.getLogger(CachedPreference.class);
+  private static final Logger log = LogManager.getLogger();
 
   public static final String ALLOW_UNPAGED_DS_MANUAL_REQUEST = "OBJSON_AllowUnpagedDatasourceManualRequest";
   public static final String ALLOW_UNSECURED_DS_REQUEST = "OBSERDS_AllowUnsecuredDatasourceRequest";
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/GlobalMenu.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/GlobalMenu.java	Tue Dec 11 12:26:44 2018 +0000
@@ -43,8 +43,8 @@
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.utility.Tree;
 import org.openbravo.model.ad.utility.TreeNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * 
@@ -55,7 +55,7 @@
  */
 @ApplicationScoped
 public class GlobalMenu {
-  private static final Logger log = LoggerFactory.getLogger(GlobalMenu.class);
+  private static final Logger log = LogManager.getLogger();
 
   private Map<String, List<MenuOption>> menuOptionsByLangAndTree = null;
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/HeartBeatPopUpComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/HeartBeatPopUpComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -39,8 +39,8 @@
 import org.openbravo.erpCommon.utility.PropertyException;
 import org.openbravo.model.ad.module.Module;
 import org.openbravo.service.db.DalConnectionProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * The component responsible for generating the content of the function used to determine if the
@@ -49,7 +49,7 @@
  */
 public class HeartBeatPopUpComponent extends SessionDynamicTemplateComponent {
 
-  private static final Logger log = LoggerFactory.getLogger(HeartBeatPopUpComponent.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String APRM_MIGRATION_TOOL_ID = "4BD3D4B262B048518FE62496EF09D549";
   private static final String COMPONENT_ID = "HeartbeatRegistration";
   private static final String TEMPLATE_ID = "EE5CEC203AEA4B039CCDAD0BE8E07E3C";
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java	Tue Dec 11 12:26:44 2018 +0000
@@ -40,8 +40,8 @@
 import org.openbravo.model.ad.ui.MenuTrl;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.utility.TreeNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Configures cached global menu (@see {@link GlobalMenu}) to adapt it to the current session's
@@ -51,7 +51,7 @@
  */
 @RequestScoped
 public class MenuManager {
-  private static final Logger log = LoggerFactory.getLogger(MenuManager.class);
+  private static final Logger log = LogManager.getLogger();
 
   public static enum MenuEntryType {
     Window, Process, ProcessManual, Report, Form, External, Summary, View, ProcessDefinition
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java	Tue Dec 11 12:26:44 2018 +0000
@@ -35,8 +35,8 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.ui.Window;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * JS - Java binding to use in JavaScript expressions.
@@ -45,7 +45,7 @@
  */
 public class OBBindings {
 
-  private static final Logger log = LoggerFactory.getLogger(OBBindings.class);
+  private static final Logger log = LogManager.getLogger();
 
   private OBContext context;
   private Map<String, String> requestMap;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ParameterUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ParameterUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -29,7 +29,8 @@
 import javax.servlet.http.HttpSession;
 
 import org.apache.axis.utils.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.expression.OBScriptEngine;
@@ -59,7 +60,7 @@
  */
 public class ParameterUtils {
 
-  private static Logger log = Logger.getLogger(ParameterUtils.class);
+  private static Logger log = LogManager.getLogger();
 
   public static void setParameterValue(ParameterValue parameterValue, JSONObject requestValue) {
     try {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ParametersActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ParametersActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 
 import javax.enterprise.context.ApplicationScoped;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.provider.OBProvider;
@@ -41,7 +42,7 @@
  */
 @ApplicationScoped
 public class ParametersActionHandler extends BaseActionHandler implements PortalAccessible {
-  private static Logger log = Logger.getLogger(ParametersActionHandler.class);
+  private static Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/PropertiesComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/PropertiesComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.client.kernel.SessionDynamicTemplateComponent;
@@ -36,7 +37,7 @@
  * @author mtaal
  */
 public class PropertiesComponent extends SessionDynamicTemplateComponent {
-  private static final Logger log = Logger.getLogger(PropertiesComponent.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   public String getId() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/StorePropertyActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/StorePropertyActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 
 import javax.enterprise.context.ApplicationScoped;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.client.kernel.BaseActionHandler;
 import org.openbravo.client.kernel.StaticResourceComponent;
@@ -45,7 +46,7 @@
  */
 @ApplicationScoped
 public class StorePropertyActionHandler extends BaseActionHandler implements PortalAccessible {
-  private static final Logger log = Logger.getLogger(StorePropertyActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   protected JSONObject execute(Map<String, Object> parameters, String data) {
     OBContext.setAdminMode();
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -18,6 +18,7 @@
  */
 package org.openbravo.client.application;
 
+import java.util.Arrays;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
@@ -53,8 +54,8 @@
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
 import org.openbravo.model.ad.utility.AttachmentMethod;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Reads the view and generates it.
@@ -63,7 +64,7 @@
  */
 @RequestScoped
 public class ViewComponent extends BaseComponent {
-  private static Logger log = LoggerFactory.getLogger(ViewComponent.class);
+  private static Logger log = LogManager.getLogger();
 
   @Inject
   private StandardWindowComponent standardWindowComponent;
@@ -88,7 +89,7 @@
     try {
       OBContext.setAdminMode();
 
-      final Window window = OBDal.getInstance().get(Window.class, correctViewId(viewId));
+      final Window window = adcs.getWindow(correctViewId(viewId));
 
       if (window != null) {
         FeatureRestriction featureRestriction = ActivationKey.getInstance().hasLicenseAccess("MW",
@@ -109,7 +110,13 @@
       } else {
         return generateView(viewId);
       }
+    } catch (Exception e) {
+      log.error("Error generating view {}", viewId, e);
+      throw e;
     } finally {
+      // view generation is read only, remove from session whatever DAL loaded to make faster flush
+      OBDal.getInstance().getSession().clear();
+
       OBContext.restorePreviousMode();
       log.debug("View {} generated in {} ms", viewId, System.currentTimeMillis() - t);
     }
@@ -159,7 +166,7 @@
   protected String generateAttachment(String viewId) {
     String[] keys = viewId.split(KernelConstants.ID_PREFIX);
     String tabId = keys[1];
-    Tab tab = OBDal.getInstance().get(Tab.class, tabId);
+    Tab tab = adcs.getTab(tabId);
     if (tab == null) {
       throw new IllegalArgumentException("Not found process definition with ID " + tabId);
     }
@@ -198,7 +205,7 @@
   @Override
   public Module getModule() {
     final String id = getParameter("viewId");
-    final Window window = OBDal.getInstance().get(Window.class, correctViewId(id));
+    final Window window = adcs.getWindow(correctViewId(id));
     if (window != null) {
       return window.getModule();
     } else if (id.startsWith("processDefinition_")) {
@@ -211,7 +218,7 @@
     } else if (id.startsWith("attachment_")) {
       String[] keys = id.split(KernelConstants.ID_PREFIX);
       String tabId = keys[1];
-      Tab tab = OBDal.getInstance().get(Tab.class, tabId);
+      Tab tab = adcs.getTab(tabId);
       if (tab == null) {
         throw new IllegalArgumentException("Not found tab with ID " + tabId);
       }
@@ -295,17 +302,19 @@
     final String viewId = getParameter("viewId");
     OBContext.setAdminMode();
     try {
-      Window window = OBDal.getInstance().get(Window.class, correctViewId(viewId));
+      String fixedViewId = correctViewId(viewId);
+      Window window = null;
+      if (!"processDefinition".equals(fixedViewId)) {
+        window = adcs.getWindow(correctViewId(viewId));
+      }
       if (window == null) {
         return "";
       }
 
       StringBuilder viewVersions = new StringBuilder();
-      for (Tab t : window.getADTabList()) {
-        viewVersions.append(t.getTable().isFullyAudited()).append("|");
-      }
-      viewVersions.append(getLastGridConfigurationChange(window)).append("|");
-      viewVersions.append(getLastSystemPreferenceChange(window)).append("|");
+      viewVersions.append(getAuditStatus(window)) //
+          .append(getLastGridConfigurationChange(window)).append("|") //
+          .append(getLastSystemPreferenceChange(window));
       return DigestUtils.md5Hex(viewVersions.toString());
     } finally {
       OBContext.restorePreviousMode();
@@ -328,37 +337,46 @@
   }
 
   private List<String> getFieldsWithDisplayLogicAtServerLevel(String windowID) {
-    StringBuilder where = new StringBuilder();
-    where.append(" select displayLogicEvaluatedInTheServer");
-    where.append(" from ADField as f");
-    where.append(" where f.displayLogicEvaluatedInTheServer is not null");
-    where.append(" and f.tab.id in (select t.id");
-    where.append("                  from ADTab t");
-    where.append("                  where t.window.id = :windowId)");
+    String where = " select displayLogicEvaluatedInTheServer" //
+        + " from ADField as f" //
+        + " where f.displayLogicEvaluatedInTheServer is not null" //
+        + " and f.tab.id in (select t.id" //
+        + "                  from ADTab t" //
+        + "                  where t.window.id = :windowId)";
 
     Session session = OBDal.getInstance().getSession();
-    Query<String> query = session.createQuery(where.toString(), String.class);
+    Query<String> query = session.createQuery(where, String.class);
     query.setParameter("windowId", windowID);
 
     return query.list();
   }
 
   private Date getLastUpdated(Set<String> preferenceSet) {
-    StringBuilder where = new StringBuilder();
-    where.append(" select max(p.updated)");
-    where.append(" from ADPreference p");
-    where.append(" where p.propertyList = true");
-    where.append(" and p.property in :properties");
-    where.append(" and p.client.id = '0'");
-    where.append(" and p.organization = '0'");
-    where.append(" and coalesce(p.visibleAtClient, '0') = '0'");
-    where.append(" and coalesce(p.visibleAtOrganization, '0') = '0'");
+    String where = " select max(p.updated)" //
+        + " from ADPreference p" //
+        + " where p.propertyList = true" //
+        + " and p.property in :properties" //
+        + " and p.client.id = '0'" //
+        + " and p.organization = '0'" //
+        + " and coalesce(p.visibleAtClient, '0') = '0'" //
+        + " and coalesce(p.visibleAtOrganization, '0') = '0'";
 
     Session session = OBDal.getInstance().getSession();
-    Query<Date> query = session.createQuery(where.toString(), Date.class);
+    Query<Date> query = session.createQuery(where, Date.class);
     query.setParameterList("properties", preferenceSet);
     Date lastUpdated = query.uniqueResult();
 
     return lastUpdated;
   }
+
+  private String getAuditStatus(Window window) {
+    String where = "select t.table.isFullyAudited " //
+        + "  from ADTab t " //
+        + " where t.window = :window " //
+        + " order by t.sequenceNumber, t.id"; //
+    Query<Boolean> q = OBDal.getInstance().getSession().createQuery(where, Boolean.class);
+    q.setParameter("window", window);
+
+    return Arrays.asList(q.list()).toString();
+  }
 }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -53,8 +53,8 @@
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
 import org.openbravo.service.db.DalConnectionProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Computes different settings which may be user/role specific for a certain window.
@@ -64,7 +64,7 @@
  */
 @ApplicationScoped
 public class WindowSettingsActionHandler extends BaseActionHandler {
-  private static final Logger log = LoggerFactory.getLogger(WindowSettingsActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   public static final String EXTRA_CALLBACKS = "extraCallbacks";
 
   @Inject
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java	Tue Dec 11 12:26:44 2018 +0000
@@ -70,8 +70,8 @@
 import org.openbravo.model.ad.utility.AttachmentMethod;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Class that centralizes the Attachment Management. Any action to manage an attachment in Openbravo
@@ -82,7 +82,7 @@
  */
 public class AttachImplementationManager {
 
-  private static final Logger log = LoggerFactory.getLogger(AttachImplementationManager.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String TEMP_DIR = System.getProperty("java.io.tmpdir");
 
   public static final String REFERENCE_LIST = "17";
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentAH.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentAH.java	Tue Dec 11 12:26:44 2018 +0000
@@ -41,8 +41,8 @@
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.utility.Attachment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Action handler to manage attachments.<br>
@@ -53,7 +53,7 @@
  */
 public class AttachmentAH extends BaseActionHandler {
 
-  private static final Logger log = LoggerFactory.getLogger(AttachmentAH.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   private AttachImplementationManager aim;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentConfigEventHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentConfigEventHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2015-2016 Openbravo SLU
+ * All portions are Copyright (C) 2015-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -33,8 +33,8 @@
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.model.ad.utility.AttachmentConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Event Handler on AttachmentConfig entity that manages the changes on the Attachment Method used
@@ -43,7 +43,7 @@
  * AttachmentUtils.
  */
 public class AttachmentConfigEventHandler extends EntityPersistenceEventObserver {
-  private static final Logger logger = LoggerFactory.getLogger(AttachmentConfigEventHandler.class);
+  private static final Logger logger = LogManager.getLogger();
 
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       AttachmentConfig.ENTITY_NAME) };
@@ -115,8 +115,9 @@
       return;
     }
     final OBQuery<AttachmentConfig> attachmentConfigQuery = OBDal.getInstance().createQuery(
-        AttachmentConfig.class, "id!=:id");
+        AttachmentConfig.class, "id!=:id and client.id=:clientId");
     attachmentConfigQuery.setNamedParameter("id", newAttachmentConfig.getId());
+    attachmentConfigQuery.setNamedParameter("clientId", newAttachmentConfig.getClient().getId());
     // Ensure that filtering by client and active is done.
     attachmentConfigQuery.setFilterOnReadableClients(true);
     attachmentConfigQuery.setFilterOnActive(true);
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentWindowComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentWindowComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2012-2016 Openbravo SLU
+ * All portions are Copyright (C) 2012-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -29,7 +29,6 @@
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.client.application.Parameter;
-import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
 import org.openbravo.client.application.window.OBViewParameterHandler;
 import org.openbravo.client.kernel.BaseTemplateComponent;
 import org.openbravo.client.kernel.KernelConstants;
@@ -39,15 +38,15 @@
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
 import org.openbravo.model.ad.utility.AttachmentMethod;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * The component which takes care of creating a class for a tab's Attachment popup.
  */
 public class AttachmentWindowComponent extends BaseTemplateComponent {
   private static final String DEFAULT_TEMPLATE_ID = "01E447F740584E02BA4612F6BDFB900D";
-  private static final Logger log = LoggerFactory.getLogger(AttachmentWindowComponent.class);
+  private static final Logger log = LogManager.getLogger();
 
   private Boolean inDevelopment = null;
   private String uniqueString = "" + System.currentTimeMillis();
@@ -57,9 +56,6 @@
   @Inject
   private OBViewParameterHandler paramHandler;
 
-  @Inject
-  private ApplicationDictionaryCachedStructures adcs;
-
   protected Template getComponentTemplate() {
     return OBDal.getInstance().get(Template.class, DEFAULT_TEMPLATE_ID);
   }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/CoreAttachImplementation.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/CoreAttachImplementation.java	Tue Dec 11 12:26:44 2018 +0000
@@ -38,8 +38,8 @@
 import org.openbravo.erpCommon.utility.PropertyException;
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.utility.Attachment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Default implementation of Attachment Management. This method saves the attached files in the
@@ -50,7 +50,7 @@
 @ApplicationScoped
 @ComponentProvider.Qualifier(AttachmentUtils.DEFAULT_METHOD)
 public class CoreAttachImplementation extends AttachImplementation {
-  private static final Logger log = LoggerFactory.getLogger(CoreAttachImplementation.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   public void uploadFile(Attachment attachment, String dataType, Map<String, Object> parameters,
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/DefaultsAttachmentActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/DefaultsAttachmentActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -39,8 +39,8 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.OBDateUtils;
 import org.openbravo.model.ad.utility.Attachment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This ActionHandler is invoked when opening a Attachment window. It is in charge of computing
@@ -48,7 +48,7 @@
  */
 public class DefaultsAttachmentActionHandler extends BaseActionHandler {
 
-  private static final Logger log = LoggerFactory.getLogger(DefaultsAttachmentActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   @Inject
   private ApplicationDictionaryCachedStructures adcs;
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/AcctSchemaEventHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/AcctSchemaEventHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,7 +25,8 @@
 
 import javax.enterprise.event.Observes;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.ScrollMode;
 import org.hibernate.ScrollableResults;
 import org.hibernate.criterion.Restrictions;
@@ -48,7 +49,7 @@
 
   private static Entity[] entities = { ModelProvider.getInstance()
       .getEntity(AcctSchema.ENTITY_NAME) };
-  protected Logger logger = Logger.getLogger(this.getClass());
+  protected Logger logger = LogManager.getLogger();
 
   @Override
   protected Entity[] getObservedEntities() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/BusinessPartnerBankAccountHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/BusinessPartnerBankAccountHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 import javax.enterprise.event.Observes;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
@@ -42,7 +43,7 @@
 
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       BankAccount.ENTITY_NAME) };
-  protected Logger logger = Logger.getLogger(this.getClass());
+  protected Logger logger = LogManager.getLogger();
 
   @Override
   protected Entity[] getObservedEntities() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/DataPoolSelectionEventHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/DataPoolSelectionEventHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import javax.enterprise.event.Observes;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.resource.transaction.spi.TransactionStatus;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -42,7 +43,7 @@
  */
 public class DataPoolSelectionEventHandler extends EntityPersistenceEventObserver {
 
-  protected Logger logger = Logger.getLogger(this.getClass());
+  protected Logger logger = LogManager.getLogger();
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       DataPoolSelection.class) };
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ElementValueEventHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ElementValueEventHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -26,7 +26,8 @@
 import javax.enterprise.event.Observes;
 
 import org.apache.commons.lang.ArrayUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.model.Entity;
@@ -47,7 +48,7 @@
 
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       ElementValue.ENTITY_NAME) };
-  protected Logger logger = Logger.getLogger(this.getClass());
+  protected Logger logger = LogManager.getLogger();
 
   @Override
   protected Entity[] getObservedEntities() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/GeneralLedgerOrganizationHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/GeneralLedgerOrganizationHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -24,7 +24,8 @@
 
 import javax.enterprise.event.Observes;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -42,7 +43,7 @@
 
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       Organization.ENTITY_NAME) };
-  protected Logger logger = Logger.getLogger(this.getClass());
+  protected Logger logger = LogManager.getLogger();
 
   @Override
   protected Entity[] getObservedEntities() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/LocationSettingsHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/LocationSettingsHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -23,7 +23,8 @@
 
 import javax.enterprise.event.Observes;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -42,7 +43,7 @@
  */
 public class LocationSettingsHandler extends EntityPersistenceEventObserver {
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(Country.ENTITY_NAME) };
-  protected Logger logger = Logger.getLogger(this.getClass());
+  protected Logger logger = LogManager.getLogger();
 
   @Override
   protected Entity[] getObservedEntities() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/NoteEventHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/NoteEventHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -39,8 +39,8 @@
 import org.openbravo.erpCommon.utility.WindowAccessData;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.service.db.DalConnectionProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Checks if the Role has access to add notes for a particular tab
@@ -48,7 +48,7 @@
  * @author shankar balachandran
  */
 public class NoteEventHandler extends EntityPersistenceEventObserver {
-  private static Logger log = LoggerFactory.getLogger(NoteEventHandler.class);
+  private static Logger log = LogManager.getLogger();
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(Note.ENTITY_NAME) };
 
   @Override
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/OpenClosePeriodHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/OpenClosePeriodHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -20,7 +20,8 @@
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -44,7 +45,7 @@
 import org.openbravo.service.db.DbUtility;
 
 public class OpenClosePeriodHandler extends BaseActionHandler {
-  private static final Logger log4j = Logger.getLogger(OpenClosePeriodHandler.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ReorderCascadingChildDeletionsHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ReorderCascadingChildDeletionsHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -23,7 +23,8 @@
 
 import javax.enterprise.event.Observes;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -50,7 +51,7 @@
  * @author shuehner
  */
 public class ReorderCascadingChildDeletionsHandler extends EntityPersistenceEventObserver {
-  private static final Logger log = Logger.getLogger(ReorderCascadingChildDeletionsHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final String ORDER_TABLE_ID = "259";
   private static final String INVOICE_TABLE_ID = "318";
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -44,8 +44,8 @@
 import org.openbravo.model.ad.utility.TableTree;
 import org.openbravo.service.datasource.DataSourceService;
 import org.openbravo.service.datasource.DataSourceServiceProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This event handler listens to events that are fired in all the tables with the flag isTree
@@ -63,7 +63,7 @@
   private static final String TREENODE_STRUCTURE = "ADTree";
   private static final String LINKTOPARENT_STRUCTURE = "LinkToParent";
   private static final String CUSTOM_STRUCTURE = "Custom";
-  private static Logger logger = LoggerFactory.getLogger(TreeTablesEventHandler.class);
+  private static Logger logger = LogManager.getLogger();
 
   @Inject
   private DataSourceServiceProvider dataSourceServiceProvider;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/UpdateInvariantCharacteristicsHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/UpdateInvariantCharacteristicsHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -38,8 +38,8 @@
 import org.openbravo.model.common.plm.ProductCharacteristic;
 import org.openbravo.model.common.plm.ProductCharacteristicValue;
 import org.openbravo.service.db.DbUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Process in charge of updating the product characteristics
@@ -55,8 +55,7 @@
  * 
  */
 public class UpdateInvariantCharacteristicsHandler extends BaseActionHandler {
-  final static private Logger log = LoggerFactory
-      .getLogger(UpdateInvariantCharacteristicsHandler.class);
+  final static private Logger log = LogManager.getLogger();
   private static final String NO_SUBSET = "-1";
 
   @Override
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/UsageAuditHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/UsageAuditHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 
 import javax.enterprise.event.Observes;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
@@ -42,7 +43,7 @@
       SYSTEM_INFO_TABLE_ID) };
   private static final Property usageAuditProperty = entities[0]
       .getProperty(SystemInformation.PROPERTY_ISUSAGEAUDITENABLED);
-  private static final Logger log = Logger.getLogger(UsageAuditHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   public void onUpdate(@Observes EntityUpdateEvent event) {
     if (!isValidEvent(event)) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/WindowPersonalizationEventHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/WindowPersonalizationEventHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -23,7 +23,8 @@
 
 import javax.enterprise.event.Observes;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.model.Entity;
@@ -46,7 +47,7 @@
 
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       UIPersonalization.ENTITY_NAME) };
-  protected Logger logger = Logger.getLogger(this.getClass());
+  protected Logger logger = LogManager.getLogger();
 
   @Override
   protected Entity[] getObservedEntities() {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/logmanagement/LogDatasource.java	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,270 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2018 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.client.application.logmanagement;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.Logger;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.spi.AbstractLogger;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.client.kernel.reference.UIDefinition;
+import org.openbravo.client.kernel.reference.UIDefinitionController;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.ad.domain.Reference;
+import org.openbravo.service.datasource.DataSourceProperty;
+import org.openbravo.service.datasource.ReadOnlyDataSourceService;
+import org.openbravo.service.json.JsonUtils;
+
+/**
+ * This datasource retrieves a list of registered Loggers and their corresponding log level
+ */
+public class LogDatasource extends ReadOnlyDataSourceService {
+  private static final org.apache.logging.log4j.Logger log = LogManager.getLogger();
+
+  private static final String LOG_LEVEL_LIST_REFERENCE_ID = "CF8CB8C4E798423081CE42078CA6BD7C";
+  private static final String STRING_REFERENCE_ID = "10";
+
+  @Override
+  protected int getCount(Map<String, String> parameters) {
+    return (int) getFilteredStream(parameters).count();
+  }
+
+  @Override
+  protected List<Map<String, Object>> getData(Map<String, String> parameters, int startRow,
+      int endRow) {
+    int rowsToFetch = endRow - startRow + 1;
+    return getFilteredStream(parameters) //
+        .sorted(getComparatorToSort(parameters)) //
+        .skip(startRow) //
+        .limit(rowsToFetch) //
+        .map(l -> {
+          Map<String, Object> r = new HashMap<>(3);
+          r.put("id", l.getName());
+          r.put("logger", l.getName());
+          r.put("level", l.getLevel().toString());
+          return r;
+        }) //
+        .collect(Collectors.toList());
+  }
+
+  private Comparator<Logger> getComparatorToSort(Map<String, String> parameters) {
+    String sortKey = parameters.containsKey("_sortBy") ? parameters.get("_sortBy") : "logger";
+    boolean reversed = sortKey.startsWith("-");
+    if (reversed) {
+      sortKey = sortKey.substring(1);
+    }
+
+    Comparator<Logger> comparator = getComparatorForSortKey(sortKey);
+    if (reversed) {
+      comparator = comparator.reversed();
+    }
+    return comparator;
+  }
+
+  private Comparator<Logger> getComparatorForSortKey(String sortKey) {
+    switch (sortKey) {
+    case "logger":
+      return Comparator.comparing(AbstractLogger::getName);
+    case "level":
+      return Comparator.comparing(Logger::getLevel);
+    default:
+      throw new IllegalArgumentException("Unkown field to sort " + sortKey);
+    }
+  }
+
+  private Stream<Logger> getFilteredStream(Map<String, String> parameters) {
+    Optional<JSONArray> criteria = getCriteria(parameters);
+    String operator = parameters.get("operator");
+
+    LoggerContext lm = (LoggerContext) LogManager.getContext(false);
+
+    return lm.getLoggers() //
+        .stream() //
+        .filter(r -> filterRow(r, criteria, operator));
+
+  }
+
+  private Optional<JSONArray> getCriteria(Map<String, String> parameters) {
+    if (parameters.containsKey("criteria")) {
+      try {
+        return Optional.of((JSONArray) JsonUtils.buildCriteria(parameters).get("criteria"));
+      } catch (JSONException e) {
+        log.error("Failed to build criteria from parameters", e);
+      }
+    }
+    return Optional.empty();
+  }
+
+  private static Optional<JSONArray> getCriteria(JSONObject criterion) {
+    if (criterion.has("criteria")) {
+      try {
+        return Optional.of(criterion.getJSONArray("criteria"));
+      } catch (JSONException e) {
+        log.error("Failed to build criteria from criterion", e);
+      }
+    }
+    return Optional.empty();
+  }
+
+  private static boolean filterRow(Logger r, Optional<JSONArray> criteria, String criteriaOperator) {
+    if (!criteria.isPresent()) {
+      return true;
+    }
+
+    boolean meetsCriteria = criteriaOperator.equals("and");
+
+    JSONArray criteriaArray = criteria.get();
+    try {
+      for (int i = 0; i < criteriaArray.length(); i++) {
+        JSONObject criterion = criteriaArray.getJSONObject(i);
+        meetsCriteria = applyOperator(meetsCriteria, loggerMeetsCriterion(r, criterion),
+            criteriaOperator);
+      }
+    } catch (JSONException e) {
+      log.error("Error matching criteria", e);
+    }
+
+    return meetsCriteria;
+  }
+
+  private static boolean applyOperator(boolean firstOperand, boolean secondOperand, String operation) {
+    if (operation.equals("or")) {
+      return firstOperand || secondOperand;
+    }
+
+    return firstOperand && secondOperand;
+  }
+
+  private static boolean loggerMeetsCriterion(Logger r, JSONObject criterion) throws JSONException {
+    String operator = criterion.getString("operator");
+    if (operator.equals("equals") || operator.equals("iContains")) {
+      String field = criterion.getString("fieldName");
+      String value = criterion.getString("value").toLowerCase();
+
+      switch (field) {
+      case "id":
+      case "logger":
+        return matchStrings(r.getName().toLowerCase(), value, operator);
+      case "level":
+        List<String> values = convertJsonArrayToStringList(new JSONArray(value));
+        return values.contains(r.getLevel().toString().toLowerCase());
+      default:
+        return true;
+      }
+    } else if (operator.equals("and") || operator.equals("or")) {
+      return filterRow(r, getCriteria(criterion), operator);
+    }
+
+    return true;
+  }
+
+  private static boolean matchStrings(String firstOperand, String secondOperand, String operator) {
+    if (operator.equals("equals")) {
+      return firstOperand.equals(secondOperand);
+    }
+
+    return firstOperand.contains(secondOperand);
+  }
+
+  private static List<String> convertJsonArrayToStringList(JSONArray array) {
+    List<String> result = new ArrayList<>();
+    try {
+      for (int i = 0; i < array.length(); i++) {
+        result.add(array.getString(i));
+      }
+    } catch (JSONException e) {
+      log.error("Failed to convert JSONArray to a list of strings", e);
+    }
+
+    return result;
+  }
+
+  /**
+   * Sets the DataSourceProperty to give the client extra info in order to display/filter the fields
+   * correctly.
+   * 
+   * @param parameters
+   *          The parameters passed to the Datasource
+   * @return A list of DataSourceProperty for each field displayed in the client
+   */
+  @Override
+  public List<DataSourceProperty> getDataSourceProperties(Map<String, Object> parameters) {
+    List<DataSourceProperty> dataSourceProperties = new ArrayList<>();
+    dataSourceProperties.add(getIdProperty());
+    dataSourceProperties.add(getLoggerProperty());
+    dataSourceProperties.add(getLevelProperty());
+
+    return dataSourceProperties;
+  }
+
+  private DataSourceProperty getLoggerProperty() {
+    final DataSourceProperty dsProperty = new DataSourceProperty();
+    dsProperty.setName("logger");
+
+    Reference loggerReference = OBDal.getInstance().get(Reference.class, STRING_REFERENCE_ID);
+    UIDefinition stringUiDefinition = UIDefinitionController.getInstance().getUIDefinition(
+        loggerReference);
+    dsProperty.setUIDefinition(stringUiDefinition);
+
+    return dsProperty;
+  }
+
+  private DataSourceProperty getIdProperty() {
+    final DataSourceProperty dsProperty = new DataSourceProperty();
+    dsProperty.setName("id");
+    dsProperty.setId(true);
+
+    Reference loggerReference = OBDal.getInstance().get(Reference.class, STRING_REFERENCE_ID);
+    UIDefinition stringUiDefinition = UIDefinitionController.getInstance().getUIDefinition(
+        loggerReference);
+    dsProperty.setUIDefinition(stringUiDefinition);
+
+    return dsProperty;
+  }
+
+  private DataSourceProperty getLevelProperty() {
+    final DataSourceProperty dsProperty = new DataSourceProperty();
+    dsProperty.setName("level");
+
+    Reference logLevelReference = OBDal.getInstance().get(Reference.class,
+        LOG_LEVEL_LIST_REFERENCE_ID);
+    UIDefinition uiDefinition = UIDefinitionController.getInstance().getUIDefinition(
+        logLevelReference);
+    dsProperty.setUIDefinition(uiDefinition);
+
+    Set<String> allowedValues = DataSourceProperty.getAllowedValues(logLevelReference);
+    dsProperty.setAllowedValues(allowedValues);
+    dsProperty.setValueMap(DataSourceProperty.createValueMap(allowedValues,
+        LOG_LEVEL_LIST_REFERENCE_ID));
+
+    return dsProperty;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/logmanagement/LogManagementActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,103 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2018 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.client.application.logmanagement;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.config.LoggerConfig;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.client.application.process.BaseProcessActionHandler;
+import org.openbravo.client.application.process.ResponseActionsBuilder;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+
+/**
+ * Action to set the log level to one or more Loggers
+ */
+public class LogManagementActionHandler extends BaseProcessActionHandler {
+
+  private static final Logger log = LogManager.getLogger();
+
+  @Override
+  protected JSONObject doExecute(Map<String, Object> parameters, String content) {
+    try {
+      JSONObject request = new JSONObject(content);
+      JSONObject params = request.getJSONObject("_params");
+      List<String> loggersToUpdate = getLoggerToUpdateList(params.getJSONObject("loggers")
+          .getJSONArray("_selection"));
+      Level newLogLevel = Level.getLevel(params.getString("loglevel"));
+
+      updateLoggerConfiguration(loggersToUpdate, newLogLevel);
+
+      return getResponseBuilder()
+          .refreshGridParameter("loggers")
+          .showMsgInProcessView(ResponseActionsBuilder.MessageType.SUCCESS,
+              OBMessageUtils.messageBD("OBUIAPP_LogLevelChanged")) //
+          .retryExecution() //
+          .build();
+
+    } catch (JSONException e) {
+      log.error("Error in set log level process", e);
+      return getResponseBuilder().showMsgInView(ResponseActionsBuilder.MessageType.ERROR,
+          OBMessageUtils.messageBD("Error"), OBMessageUtils.messageBD("Error")).build();
+    }
+  }
+
+  private List<String> getLoggerToUpdateList(JSONArray array) {
+    List<String> result = new ArrayList<>();
+
+    for (int i = 0; i < array.length(); i++) {
+      try {
+        result.add(array.getJSONObject(i).getString("logger"));
+      } catch (JSONException e) {
+        log.error("Error getting logger name for index {}", i);
+      }
+    }
+
+    return result;
+  }
+
+  private void updateLoggerConfiguration(List<String> loggersToUpdate, Level newLogLevel) {
+    final LoggerContext context = LoggerContext.getContext(false);
+    final Configuration config = context.getConfiguration();
+
+    for (String loggerName : loggersToUpdate) {
+      LoggerConfig loggerConfig = config.getLoggerConfig(loggerName);
+
+      LoggerConfig specificConfig = loggerConfig;
+      if (!loggerConfig.getName().equals(loggerName)) {
+        specificConfig = new LoggerConfig(loggerName, newLogLevel, true);
+        specificConfig.setParent(loggerConfig);
+        config.addLogger(loggerName, specificConfig);
+      }
+      specificConfig.setLevel(newLogLevel);
+      log.info("Setting logger {} to level {}", loggerName, newLogLevel.toString());
+    }
+
+    context.updateLoggers();
+  }
+}
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -225,6 +225,9 @@
   // ugly inheriting from HttpSecureAppServlet because it provides a number of methods...
   private static class UserSessionSetter extends HttpSecureAppServlet {
     private static final long serialVersionUID = 1L;
+    private static final String TEXT_DIRECTION = "#TextDirection";
+    private static final String SESSION_ID = "#AD_Session_ID";
+    private static final String AUTHENTICATED_USER = "#Authenticated_user";
 
     private void resetSession(HttpServletRequest request, boolean isDefault, String userId,
         String roleId, String clientId, String organizationId, String languageId,
@@ -232,9 +235,9 @@
       final VariablesSecureApp vars = new VariablesSecureApp(request); // refresh
       final Language language = OBDal.getInstance().get(Language.class, languageId);
       if (language.isRTLLanguage()) {
-        vars.setSessionValue("#TextDirection", "RTL");
+        vars.setSessionValue(TEXT_DIRECTION, "RTL");
       } else {
-        vars.setSessionValue("#TextDirection", "LTR");
+        vars.setSessionValue(TEXT_DIRECTION, "LTR");
       }
 
       if (isDefault) {
@@ -259,11 +262,11 @@
       }
 
       // Clear session variables maintaining session and user
-      String sessionID = vars.getSessionValue("#AD_Session_ID");
-      String sessionUser = (String) request.getSession(true).getAttribute("#Authenticated_user");
+      String sessionID = vars.getSessionValue(SESSION_ID);
+      String sessionUser = (String) request.getSession(true).getAttribute(AUTHENTICATED_USER);
       vars.clearSession(false);
-      vars.setSessionValue("#AD_Session_ID", sessionID);
-      request.getSession(true).setAttribute("#Authenticated_user", sessionUser);
+      vars.setSessionValue(SESSION_ID, sessionID);
+      request.getSession(true).setAttribute(AUTHENTICATED_USER, sessionUser);
 
       OBDal.getInstance().flush();
       boolean result = LoginUtils
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -47,8 +47,8 @@
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
 import org.openbravo.model.common.enterprise.Organization;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Handles personalization settings, stores them and retrieves them, taking into account priority
@@ -56,7 +56,7 @@
  */
 @RequestScoped
 public class PersonalizationHandler {
-  private static final Logger log = LoggerFactory.getLogger(PersonalizationHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   /**
    * Returns all the personalization settings in an object keyed by tabid. The current client, org,
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/process/BaseProcessActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/process/BaseProcessActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
@@ -48,7 +49,7 @@
  */
 public abstract class BaseProcessActionHandler extends BaseActionHandler {
 
-  private static final Logger log = Logger.getLogger(BaseProcessActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final String GRID_REFERENCE_ID = "FF80818132D8F0F30132D9BC395D0038";
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/process/DefaultsProcessActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/process/DefaultsProcessActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,7 +25,8 @@
 import javax.servlet.http.HttpSession;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.model.Entity;
@@ -53,7 +54,7 @@
  */
 public class DefaultsProcessActionHandler extends BaseProcessActionHandler {
 
-  private static final Logger log = Logger.getLogger(DefaultsProcessActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String WINDOW_REFERENCE_ID = "FF80818132D8F0F30132D9BC395D0038";
 
   @Override
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/process/ResponseActionsBuilder.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/process/ResponseActionsBuilder.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2017 Openbravo SLU
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,15 +21,15 @@
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This class is a helper that can be used to build the standard response actions of a
  * {@link BaseProcessActionHandler} in an easy way.
  */
 public class ResponseActionsBuilder {
-  private static final Logger log = LoggerFactory.getLogger(ResponseActionsBuilder.class);
+  private static final Logger log = LogManager.getLogger();
 
   private JSONArray responseActions;
   private JSONObject retryExecutionMsg;
@@ -266,7 +266,33 @@
     try {
       retryExecution = true;
       retryExecutionMsg = new JSONObject();
-      retryExecutionMsg.put("msgType", msgType.getType());
+      retryExecutionMsg.put("severity", msgType.getType());
+      retryExecutionMsg.put("text", msgText);
+    } catch (JSONException ignore) {
+    }
+    return this;
+  }
+
+  /**
+   * Allows to re-execute the process again, by enabling the process UI. This is useful to do
+   * backend validations as this allows the user to fix data and resubmit again. In addition, a
+   * message will be displayed with the severity, title and text specified with the parameters of
+   * this method.
+   *
+   * @param msgType
+   *          The message type.
+   * @param msgTitle
+   *          The title of the message.
+   * @param msgText
+   *          The text of the message.
+   * @return a ResponseActionsBuilder configured to retry the process execution.
+   */
+  public ResponseActionsBuilder retryExecution(MessageType msgType, String msgTitle, String msgText) {
+    try {
+      retryExecution = true;
+      retryExecutionMsg = new JSONObject();
+      retryExecutionMsg.put("severity", msgType.getType());
+      retryExecutionMsg.put("title", msgTitle);
       retryExecutionMsg.put("text", msgText);
     } catch (JSONException ignore) {
     }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/BaseReportActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/BaseReportActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -72,8 +72,8 @@
 import org.openbravo.service.db.DbUtility;
 import org.openbravo.userinterface.selector.reference.FKMultiSelectorUIDefinition;
 import org.openbravo.utils.FileUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 import net.sf.jasperreports.engine.JRDataSource;
 
@@ -83,7 +83,7 @@
  * 
  */
 public class BaseReportActionHandler extends BaseProcessActionHandler {
-  private static final Logger log = LoggerFactory.getLogger(BaseReportActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String JASPER_PARAM_PROCESS = "jasper_process";
   protected static final String JASPER_REPORT_PARAMETERS = "JASPER_REPORT_PARAMETERS";
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/CompiledReportManager.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/CompiledReportManager.java	Tue Dec 11 12:26:44 2018 +0000
@@ -28,8 +28,8 @@
 import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.service.db.DalConnectionProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 import net.sf.jasperreports.engine.JRException;
 import net.sf.jasperreports.engine.JasperReport;
@@ -39,7 +39,7 @@
  * cache, avoiding unnecessary compilations when the same report is generated multiple times.
  */
 class CompiledReportManager {
-  private static final Logger log = LoggerFactory.getLogger(CompiledReportManager.class);
+  private static final Logger log = LogManager.getLogger();
   private static CompiledReportManager instance = new CompiledReportManager();
 
   private ConcurrentHashMap<String, CompiledReport> compiledReports;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportCompiler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportCompiler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -31,8 +31,8 @@
 import org.openbravo.service.db.DalConnectionProvider;
 import org.openbravo.uiTranslation.TranslationHandler;
 import org.openbravo.utils.Replace;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 import net.sf.jasperreports.engine.JRException;
 import net.sf.jasperreports.engine.JasperCompileManager;
@@ -46,7 +46,7 @@
  * passed as parameters within the report design.
  */
 class ReportCompiler {
-  private static final Logger log = LoggerFactory.getLogger(ReportCompiler.class);
+  private static final Logger log = LogManager.getLogger();
 
   // connection provider used to retrieve the translated texts
   private ConnectionProvider connectionProvider;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportFiller.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportFiller.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,8 +25,8 @@
 import org.openbravo.base.exception.OBException;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.database.ConnectionProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 import net.sf.jasperreports.engine.JRDataSource;
 import net.sf.jasperreports.engine.JRException;
@@ -38,7 +38,7 @@
  * This class is used to fill the data of the reports.
  */
 class ReportFiller {
-  private static final Logger log = LoggerFactory.getLogger(ReportFiller.class);
+  private static final Logger log = LogManager.getLogger();
 
   // main report file path
   private String templatePath;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportSemaphoreHandling.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportSemaphoreHandling.java	Tue Dec 11 12:26:44 2018 +0000
@@ -26,8 +26,8 @@
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.PropertyConflictException;
 import org.openbravo.erpCommon.utility.PropertyException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * A class which can be used to limit the number of parallel processes running. If no semaphore is
@@ -58,7 +58,7 @@
   private static int DEFAULT_MAX_THREADS = 3;
   private static int maxThreads;
 
-  private static final Logger log = LoggerFactory.getLogger(ReportSemaphoreHandling.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static ReportSemaphoreHandling instance;
   private Semaphore semaphore;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -45,8 +45,8 @@
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.StringCollectionUtils;
 import org.openbravo.model.ad.utility.FileType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 import net.sf.jasperreports.engine.JRDataSource;
 import net.sf.jasperreports.engine.JRException;
@@ -101,7 +101,7 @@
 
   private static final float TEXT_CHAR_HEIGHT = 10;
   private static final float TEXT_CHAR_WIDTH = 10;
-  private static final Logger log = LoggerFactory.getLogger(ReportingUtils.class);
+  private static final Logger log = LogManager.getLogger();
   private static CompiledReportManager compiledReportManager = CompiledReportManager.getInstance();
 
   /**
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java	Tue Dec 11 12:26:44 2018 +0000
@@ -19,11 +19,13 @@
 package org.openbravo.client.application.window;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Collectors;
 
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
@@ -45,12 +47,13 @@
 import org.openbravo.model.ad.module.Module;
 import org.openbravo.model.ad.ui.AuxiliaryInput;
 import org.openbravo.model.ad.ui.Field;
+import org.openbravo.model.ad.ui.Process;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
 import org.openbravo.userinterface.selector.Selector;
 import org.openbravo.userinterface.selector.SelectorField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This class caches some AD structures used by the Form Initialization component. Basically, it
@@ -60,8 +63,7 @@
  */
 @ApplicationScoped
 public class ApplicationDictionaryCachedStructures {
-  private static final Logger log = LoggerFactory
-      .getLogger(ApplicationDictionaryCachedStructures.class);
+  private static final Logger log = LogManager.getLogger();
 
   private Map<String, Window> windowMap;
   private Map<String, Tab> tabMap;
@@ -204,6 +206,11 @@
       }
 
       Window window = OBDal.getInstance().get(Window.class, windowId);
+      if (window == null) {
+        return;
+      }
+
+      initializeDALObject(window.getModule());
       for (Tab tab : window.getADTabList()) {
         initializeTab(tab);
       }
@@ -231,6 +238,8 @@
     getFieldsOfTab(tab);
     initializeDALObject(tab.getTable());
     getColumnsOfTable(tab.getTable().getId());
+    initializeProcess(tab.getProcess());
+    initializeDALObject(tab.getTableTree());
 
     if (useCache()) {
       tabMap.put(tabId, tab);
@@ -245,6 +254,7 @@
     Table table = OBDal.getInstance().get(Table.class, tableId);
     initializeDALObject(table);
     initializeDALObject(table.getADColumnList());
+    initializeDALObject(table.getObserdsDatasource());
     if (useCache()) {
       tableMap.put(tableId, table);
     }
@@ -263,10 +273,11 @@
     String tableId = tab.getTable().getId();
     List<Field> fields = tab.getADFieldList();
     for (Field f : fields) {
+      initializeDALObject(f.getFieldGroup());
+
       if (f.getColumn() == null) {
         continue;
       }
-      initializeDALObject(f.getColumn());
       initializeColumn(f.getColumn());
 
       // Property fields can link to columns in a different table than tab's one, in this case
@@ -297,6 +308,7 @@
   }
 
   private void initializeColumn(Column c) {
+    initializeDALObject(c);
     initializeDALObject(c.getValidation());
     if (c.getValidation() != null) {
       initializeDALObject(c.getValidation().getValidationCode());
@@ -316,12 +328,31 @@
     if (c.getReferenceSearchKey() != null) {
       initializeReference(c.getReferenceSearchKey());
     }
+
+    initializeDALObject(c.getOBUIAPPProcess());
+    initializeProcess(c.getProcess());
+
+  }
+
+  private void initializeProcess(Process p) {
+    if (p == null) {
+      return;
+    }
+    initializeDALObject(p);
+    initializeDALObject(p.getModule());
+    initializeDALObject(p.getADModelImplementationList());
+    p.getADModelImplementationList().stream()
+        //
+        .filter(ModelImplementation::isDefault)
+        .forEach(m -> initializeDALObject(m.getADModelImplementationMappingList()));
+
   }
 
   private void initializeReference(Reference reference) {
     initializeDALObject(reference.getADReferencedTableList());
     for (ReferencedTable t : reference.getADReferencedTableList()) {
       initializeDALObject(t);
+      initializeDALObject(t.getDisplayedColumn().getTable());
     }
 
     initializeDALObject(reference.getOBUISELSelectorList());
@@ -343,6 +374,13 @@
       initializeDALObject(list);
     }
     initializeDALObject(reference.getOBUIAPPRefWindowList());
+
+    for (ReferencedTree refTree : reference.getADReferencedTreeList()) {
+      initializeDALObject(refTree);
+      for (ReferencedTreeField refTreeField : refTree.getADReferencedTreeFieldList()) {
+        initializeDALObject(refTreeField);
+      }
+    }
   }
 
   public List<AuxiliaryInput> getAuxiliarInputList(String tabId) {
@@ -496,4 +534,10 @@
             "update " + Module.ENTITY_NAME + " set " + Module.PROPERTY_INDEVELOPMENT + " = false")
         .executeUpdate();
   }
+
+  Collection<String> getCachedWindows() {
+    return windowMap.values().stream() //
+        .map(Window::toString) //
+        .collect(Collectors.toList());
+  }
 }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -35,7 +35,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -105,7 +106,7 @@
  * placed in the request/session for subsequent callout computations.
  */
 public class FormInitializationComponent extends BaseActionHandler {
-  private static final Logger log = Logger.getLogger(FormInitializationComponent.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final int MAX_CALLOUT_CALLS = 50;
 
@@ -1371,8 +1372,9 @@
   }
 
   private void setSessionValue(String key, Object value) {
-    log.debug("Setting session value. Key: " + key + "  Value:" + value);
-    RequestContext.get().setSessionAttribute(key, value);
+    log.debug("Setting session value. Key: " + key + "  Value:" + value + " - type "
+        + (value != null ? value.getClass() : null));
+    RequestContext.get().setSessionAttribute(key, value != null ? value.toString() : null);
   }
 
   private void setRequestContextParameter(Field field, JSONObject jsonObj) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/GetTabMessageActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/GetTabMessageActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 
 import javax.enterprise.context.ApplicationScoped;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.client.kernel.BaseActionHandler;
 import org.openbravo.client.kernel.RequestContext;
@@ -34,7 +35,7 @@
  */
 @ApplicationScoped
 public class GetTabMessageActionHandler extends BaseActionHandler {
-  private static final Logger log = Logger.getLogger(GetTabMessageActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ImagesActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ImagesActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -20,7 +20,8 @@
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -49,7 +50,7 @@
  */
 public class ImagesActionHandler extends BaseActionHandler implements PortalAccessible {
 
-  private static final Logger log = Logger.getLogger(ImagesActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String content) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/JmxApplicationDictionaryCachedStructures.java	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,50 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo SLU 
+ * All portions are Copyright (C) 2018 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.client.application.window;
+
+import java.util.Collection;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+/** Exposes {@link ApplicationDictionaryCachedStructures} as a JMX Bean. */
+@ApplicationScoped
+public class JmxApplicationDictionaryCachedStructures implements
+    JmxApplicationDictionaryCachedStructuresMBean {
+  public static final String MBEAN_NAME = "ApplicationDictionaryCachedStructures";
+
+  @Inject
+  private ApplicationDictionaryCachedStructures adcs;
+
+  @Override
+  public void resetCache() {
+    adcs.init();
+  }
+
+  @Override
+  public boolean isEnabled() {
+    return adcs.useCache();
+  }
+
+  @Override
+  public Collection<String> getCachedWindows() {
+    return adcs.getCachedWindows();
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/JmxApplicationDictionaryCachedStructuresMBean.java	Tue Dec 11 12:26:44 2018 +0000
@@ -0,0 +1,38 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo SLU 
+ * All portions are Copyright (C) 2018 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.client.application.window;
+
+import java.util.Collection;
+
+/** Defines bean to expose {@link ApplicationDictionaryCachedStructures} as a JMX Bean. */
+public interface JmxApplicationDictionaryCachedStructuresMBean {
+
+  /** Resets cache removing anything it might contain. */
+  void resetCache();
+
+  /**
+   * Whether ADCS is enabled. ADCS is enabled when it was initialized without modules in
+   * development.
+   */
+  boolean isEnabled();
+
+  /** Lists Windows cached in ADCS. */
+  Collection<String> getCachedWindows();
+}
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeReferenceComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeReferenceComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -60,8 +60,8 @@
 import org.openbravo.service.datasource.DataSourceProperty;
 import org.openbravo.service.datasource.DataSourceProperty.RefListEntry;
 import org.openbravo.service.json.JsonConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * The backing bean for generating the OBTreeReference client-side representation.
@@ -81,7 +81,7 @@
   private ReferencedTree referencedTree;
   private List<ReferencedTreeField> treeFields;
 
-  private static Logger log = LoggerFactory.getLogger(OBTreeReferenceComponent.class);
+  private static Logger log = LogManager.getLogger();
 
   @Override
   protected Template getComponentTemplate() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -26,12 +26,14 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 
 import javax.script.ScriptException;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.expression.OBScriptEngine;
@@ -41,6 +43,8 @@
 import org.openbravo.base.model.domaintype.ForeignKeyDomainType;
 import org.openbravo.client.application.ApplicationUtils;
 import org.openbravo.client.application.DynamicExpressionParser;
+import org.openbravo.client.application.GCSystem;
+import org.openbravo.client.application.GCTab;
 import org.openbravo.client.kernel.KernelUtils;
 import org.openbravo.client.kernel.reference.FKSearchUIDefinition;
 import org.openbravo.client.kernel.reference.StringUIDefinition;
@@ -63,7 +67,7 @@
 
 public class OBViewFieldHandler {
 
-  private static Logger log = Logger.getLogger(OBViewFieldHandler.class);
+  private static Logger log = LogManager.getLogger();
 
   private String parentProperty;
 
@@ -86,6 +90,9 @@
 
   private List<Field> ignoredFields = new ArrayList<Field>();
 
+  private Optional<GCSystem> systemGridConfig;
+  private Map<String, Optional<GCTab>> tabsGridConfig;
+
   public Tab getTab() {
     return tab;
   }
@@ -229,19 +236,19 @@
     }
     List<OBViewFieldDefinition> auditFields = new ArrayList<OBViewFieldDefinition>();
     if (!hasCreatedField) {
-      OBViewFieldAudit audit = new OBViewFieldAudit("creationDate", OBViewUtil.createdElement, tab);
+      OBViewFieldAudit audit = new OBViewFieldAudit("creationDate", OBViewUtil.createdElement);
       auditFields.add(audit);
     }
     if (!hasCreatedByField) {
-      OBViewFieldAudit audit = new OBViewFieldAudit("createdBy", OBViewUtil.createdByElement, tab);
+      OBViewFieldAudit audit = new OBViewFieldAudit("createdBy", OBViewUtil.createdByElement);
       auditFields.add(audit);
     }
     if (!hasUpdatedField) {
-      OBViewFieldAudit audit = new OBViewFieldAudit("updated", OBViewUtil.updatedElement, tab);
+      OBViewFieldAudit audit = new OBViewFieldAudit("updated", OBViewUtil.updatedElement);
       auditFields.add(audit);
     }
     if (!hasUpdatedByField) {
-      OBViewFieldAudit audit = new OBViewFieldAudit("updatedBy", OBViewUtil.updatedByElement, tab);
+      OBViewFieldAudit audit = new OBViewFieldAudit("updatedBy", OBViewUtil.updatedByElement);
       auditFields.add(audit);
     }
 
@@ -641,8 +648,6 @@
     private String refType;
     private String refEntity;
     private Element element;
-    private Tab auditTab;
-    JSONObject gridConfiguration;
 
     public String getOnChangeFunction() {
       return null;
@@ -678,14 +683,9 @@
     }
 
     public OBViewFieldAudit(String type, Element element) {
-      this(type, element, null);
-    }
-
-    public OBViewFieldAudit(String type, Element element, Tab tab) {
       // force reload of element as if it was previously loaded but its children were not touched,
       // lazy initialization fails
       this.element = OBDal.getInstance().get(Element.class, element.getId());
-      this.auditTab = tab;
       name = type;
       if (type.endsWith("By")) {
         // User search
@@ -699,29 +699,26 @@
     }
 
     public String getGridFieldProperties() {
-      StringBuffer result = new StringBuffer();
+      StringBuilder result = new StringBuilder();
       if (SEARCH_REFERENCE.equals(refType)) {
         result.append(", fkField: true");
       }
-      if (this.gridConfiguration != null) {
-        Boolean canSort = null;
-        Boolean canFilter = null;
+
+      if (tab != null) {
+        JSONObject gridConfiguration = OBViewUtil.getGridConfigurationSettings(systemGridConfig,
+            getTabGridConfig());
         try {
-          if (this.gridConfiguration.has("canFilter")) {
-            canFilter = (Boolean) this.gridConfiguration.get("canFilter");
+          if (gridConfiguration.has("canFilter")) {
+            boolean canFilter = gridConfiguration.getBoolean("canFilter");
+            result.append(", canFilter: ").append(canFilter);
           }
-          if (this.gridConfiguration.has("canSort")) {
-            canSort = (Boolean) this.gridConfiguration.get("canSort");
+          if (gridConfiguration.has("canSort")) {
+            boolean canSort = gridConfiguration.getBoolean("canSort");
+            result.append(", canSort: ").append(canSort);
           }
         } catch (JSONException e) {
           log.error("Error while getting the grid field properties of an audit field", e);
         }
-        if (canSort != null) {
-          result.append(", canSort: " + canSort.toString());
-        }
-        if (canFilter != null) {
-          result.append(", canFilter: " + canFilter.toString());
-        }
       }
       result.append(", showHover: true");
       return result.toString();
@@ -789,12 +786,7 @@
 
     @Override
     public String getFieldProperties() {
-      if (tab != null) {
-        gridConfiguration = OBViewUtil.getGridConfigurationSettings(auditTab);
-        return "";
-      } else {
-        return "";
-      }
+      return "";
     }
 
     @Override
@@ -1180,6 +1172,10 @@
     }
   }
 
+  private Optional<GCTab> getTabGridConfig() {
+    return tabsGridConfig.get(tab.getId());
+  }
+
   public class OBViewField implements OBViewFieldDefinition {
     private Field field;
     private Property property;
@@ -1344,7 +1340,8 @@
 
     public String getFieldProperties() {
       // First obtain the gridConfigurationSettings which will be used in other places
-      getUIDefinition().establishGridConfigurationSettings(field);
+      getUIDefinition().establishGridConfigurationSettings(field, systemGridConfig,
+          getTabGridConfig());
 
       if (getClientClass().length() > 0) {
         return "editorType: 'OBClientClassCanvasItem', ";
@@ -2334,4 +2331,10 @@
     return (entity == null) ? false : entity.hasProperty("processed");
   }
 
+  void setGCSettings(Optional<GCSystem> systemGridConfig,
+      Map<String, Optional<GCTab>> tabsGridConfig) {
+    this.systemGridConfig = systemGridConfig;
+    this.tabsGridConfig = tabsGridConfig;
+  }
+
 }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2010-2017 Openbravo SLU
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -22,6 +22,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 
 import org.apache.commons.lang.StringUtils;
 import org.hibernate.criterion.Restrictions;
@@ -42,7 +43,6 @@
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
-import org.openbravo.dal.service.OBQuery;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.ui.AuxiliaryInput;
@@ -73,6 +73,8 @@
   private Entity entity;
 
   private OBViewTab viewTab;
+  private Optional<GCSystem> systemGridConfig;
+  private Map<String, Optional<GCTab>> tabsGridConfig;
 
   protected Template getComponentTemplate() {
     final String windowType = tab.getWindow().getWindowType();
@@ -423,37 +425,20 @@
 
   private boolean isConfigurationPropertyEnabled(String propertyNameAtTabLevel,
       String propertyNameAtSystemLevel, boolean defaultReturnValue) {
-    Boolean propertyEnabled = null;
-
-    // Trying to get parameters from "Grid Configuration (Tab/Field)" -> "Tab" window
-    List<GCTab> tabConfs = getGridConfigurationForTab();
-    if (!tabConfs.isEmpty()) {
-      if ("Y".equals(tabConfs.get(0).get(propertyNameAtTabLevel))) {
-        propertyEnabled = true;
-      } else if ("N".equals(tabConfs.get(0).get(propertyNameAtTabLevel))) {
-        propertyEnabled = false;
+    Optional<GCTab> tabConf = tabsGridConfig.get(tab.getId());
+    if (tabConf.isPresent()) {
+      if ("Y".equals(tabConf.get().get(propertyNameAtTabLevel))) {
+        return true;
+      } else if ("N".equals(tabConf.get().get(propertyNameAtTabLevel))) {
+        return false;
       }
     }
-    if (propertyEnabled == null) {
-      // Trying to get parameters from "Grid Configuration (System)" window
-      List<GCSystem> sysConfs = OBDal.getInstance().createQuery(GCSystem.class, "").list();
-      if (!sysConfs.isEmpty()) {
-        propertyEnabled = (Boolean) sysConfs.get(0).get(propertyNameAtSystemLevel);
-      }
+
+    if (systemGridConfig.isPresent()) {
+      return (boolean) systemGridConfig.get().get(propertyNameAtSystemLevel);
     }
-    if (propertyEnabled != null) {
-      return propertyEnabled;
-    } else {
-      return defaultReturnValue;
-    }
-  }
 
-  private List<GCTab> getGridConfigurationForTab() {
-    String tabConfsHql = " as p where p.tab.id = :tabId";
-    // Trying to get parameters from "Grid Configuration (Tab/Field)" -> "Tab" window
-    OBQuery<GCTab> query = OBDal.getInstance().createQuery(GCTab.class, tabConfsHql);
-    query.setNamedParameter("tabId", tab.getId());
-    return query.list();
+    return defaultReturnValue;
   }
 
   public boolean getAlwaysFilterFksByIdentifier() {
@@ -476,4 +461,10 @@
   private boolean isDatasourceBasedTable(Table table) {
     return ApplicationConstants.DATASOURCEBASEDTABLE.equals(table.getDataOriginType());
   }
+
+  void setGCSettings(Optional<GCSystem> systemGridConfig,
+      Map<String, Optional<GCTab>> tabsGridConfig) {
+    this.systemGridConfig = systemGridConfig;
+    this.tabsGridConfig = tabsGridConfig;
+  }
 }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewParameterHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewParameterHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2012-2016 Openbravo SLU 
+ * All portions are Copyright (C) 2012-2018 Openbravo SLU 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -25,7 +25,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.client.application.DynamicExpressionParser;
 import org.openbravo.client.application.Parameter;
@@ -34,6 +35,7 @@
 import org.openbravo.client.kernel.reference.UIDefinition;
 import org.openbravo.client.kernel.reference.UIDefinitionController;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.domain.ListTrl;
 import org.openbravo.model.ad.domain.Reference;
 import org.openbravo.model.ad.ui.FieldGroup;
@@ -42,7 +44,7 @@
 import org.openbravo.userinterface.selector.reference.FKSelectorUIDefinition;
 
 public class OBViewParameterHandler {
-  private static final Logger log = Logger.getLogger(OBViewParameterHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String WINDOW_REFERENCE_ID = "FF80818132D8F0F30132D9BC395D0038";
   private static final int NUMBER_COLUMNS = 4;
   private BaseTemplateComponent paramWindow;
@@ -256,24 +258,28 @@
     }
 
     public String getTabView() {
-      Window window;
+      String tabId = OBDal
+          .getInstance()
+          .getSession()
+          .createQuery(
+              "select t.id from OBUIAPP_Parameter p join p.referenceSearchKey r join r.oBUIAPPRefWindowList rw join rw.window w join w.aDTabList t where p.id=:param",
+              String.class) //
+          .setParameter("param", parameter.getId()) //
+          .setMaxResults(1) //
+          .uniqueResult();
 
-      if (parameter.getReferenceSearchKey().getOBUIAPPRefWindowList().size() == 0
-          || parameter.getReferenceSearchKey().getOBUIAPPRefWindowList().get(0).getWindow() == null) {
-        return null;
-      } else {
-        window = parameter.getReferenceSearchKey().getOBUIAPPRefWindowList().get(0).getWindow();
-      }
-
-      if (window.getADTabList().isEmpty()) {
-        log.error("Window definition " + window.getName() + " has no tabs");
+      if (tabId == null) {
+        log.error("Window definition for parameter " + parameter + " has no tabs");
         return null;
       }
 
-      Tab tab = window.getADTabList().get(0);
+      // parameters are not cached in ADCS
+      Tab tab = paramWindow.getADCS().getTab(tabId);
 
       final OBViewTab tabComponent = paramWindow.createComponent(OBViewTab.class);
       tabComponent.setTab(tab);
+      tabComponent.setGCSettings(StandardWindowComponent.getSystemGridConfig(),
+          StandardWindowComponent.getTabsGridConfig(tab.getWindow()));
       return tabComponent.generate();
     }
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2010-2015 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -26,10 +26,12 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
@@ -39,6 +41,8 @@
 import org.openbravo.client.application.ApplicationConstants;
 import org.openbravo.client.application.ApplicationUtils;
 import org.openbravo.client.application.DynamicExpressionParser;
+import org.openbravo.client.application.GCSystem;
+import org.openbravo.client.application.GCTab;
 import org.openbravo.client.kernel.BaseTemplateComponent;
 import org.openbravo.client.kernel.Component;
 import org.openbravo.client.kernel.ComponentProvider;
@@ -60,7 +64,6 @@
 import org.openbravo.model.ad.ui.Field;
 import org.openbravo.model.ad.ui.Process;
 import org.openbravo.model.ad.ui.Tab;
-import org.openbravo.model.ad.ui.TabTrl;
 import org.openbravo.service.datasource.DataSourceComponent;
 import org.openbravo.service.datasource.DataSourceConstants;
 import org.openbravo.service.db.DalConnectionProvider;
@@ -75,7 +78,7 @@
  */
 public class OBViewTab extends BaseTemplateComponent {
 
-  private static final Logger log = Logger.getLogger(OBViewTab.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String DEFAULT_TEMPLATE_ID = "B5124C0A450D4D3A867AEAC7DF64D6F0";
   protected static final Map<String, String> TEMPLATE_MAP = new HashMap<String, String>();
 
@@ -106,6 +109,8 @@
   @Inject
   @ComponentProvider.Qualifier(DataSourceConstants.DS_COMPONENT_TYPE)
   private ComponentProvider dsComponentProvider;
+  private Map<String, Optional<GCTab>> tabsGridConfig;
+  private Optional<GCSystem> systemGridConfig;
 
   public String getDataSourceJavaScript() {
     final String dsId = getDataSourceId();
@@ -194,7 +199,7 @@
   }
 
   public String getMapping250() {
-    return Utility.getTabURL(tab.getId(), "none", false);
+    return Utility.getTabURL(tab, "none", false);
   }
 
   public List<ButtonField> getButtonFields() {
@@ -219,6 +224,13 @@
     return buttonFields;
   }
 
+  public void setGCSettings(Optional<GCSystem> systemGridConfig,
+      Map<String, Optional<GCTab>> tabsGridConfig) {
+    fieldHandler.setGCSettings(systemGridConfig, tabsGridConfig);
+    this.systemGridConfig = systemGridConfig;
+    this.tabsGridConfig = tabsGridConfig;
+  }
+
   public List<ButtonField> getAllButtonFields() {
     if (allButtonFields != null) {
       return allButtonFields;
@@ -334,9 +346,6 @@
   }
 
   public String getViewForm() {
-    // force a load all the columns of the table
-    getTab().getTable().getADColumnList().size();
-
     final OBViewFormComponent viewFormComponent = createComponent(OBViewFormComponent.class);
     viewFormComponent.setParameters(getParameters());
     viewFormComponent.setParentProperty(getParentProperty());
@@ -345,9 +354,6 @@
   }
 
   public String getViewGrid() {
-    // force a load all the columns of the table
-    getTab().getTable().getADColumnList().size();
-
     // check at least one field is visible in grid view, does not stop the execution
     OBCriteria<Field> fieldCriteria = OBDal.getInstance().createCriteria(Field.class);
     fieldCriteria.add(Restrictions.eq(Field.PROPERTY_TAB, getTab()));
@@ -363,6 +369,7 @@
     viewGridComponent.setViewTab(this);
     viewGridComponent.setApplyTransactionalFilter(isRootTab()
         && this.tab.getWindow().getWindowType().equals("T"));
+    viewGridComponent.setGCSettings(systemGridConfig, tabsGridConfig);
     return viewGridComponent.generate();
   }
 
@@ -463,18 +470,7 @@
 
   public String getTabTitle() {
     if (tabTitle == null) {
-      if (OBContext.hasTranslationInstalled()) {
-        final String userLanguageId = OBContext.getOBContext().getLanguage().getId();
-        for (TabTrl tabTrl : tab.getADTabTrlList()) {
-          final String trlLanguageId = tabTrl.getLanguage().getId();
-          if (trlLanguageId.equals(userLanguageId)) {
-            tabTitle = tabTrl.getName();
-          }
-        }
-      }
-      if (tabTitle == null) {
-        tabTitle = tab.getName();
-      }
+      tabTitle = OBViewUtil.getLabel(tab, tab.getADTabTrlList(), Tab.PROPERTY_NAME);
     }
     return tabTitle;
   }
@@ -820,7 +816,7 @@
 
         if (manualProcessMapping == null) {
           // Standard UI process
-          url = Utility.getTabURL(fld.getTab().getId(), "E", false);
+          url = Utility.getTabURL(fld.getTab(), "E", false);
           command = "BUTTON" + FormatUtilities.replace(column.getDBColumnName())
               + column.getProcess().getId();
         } else {
@@ -835,7 +831,7 @@
         String colName = column.getDBColumnName();
         if ("Posted".equalsIgnoreCase(colName) || "CreateFrom".equalsIgnoreCase(colName)) {
           command = "BUTTON" + colName;
-          url = Utility.getTabURL(fld.getTab().getId(), "E", false);
+          url = Utility.getTabURL(fld.getTab(), "E", false);
         }
       }
 
@@ -1149,4 +1145,5 @@
     }
 
   }
+
 }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewUtil.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewUtil.java	Tue Dec 11 12:26:44 2018 +0000
@@ -11,35 +11,35 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2016 Openbravo SLU
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
 package org.openbravo.client.application.window;
 
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
+import java.util.Optional;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.Hibernate;
-import org.hibernate.criterion.Order;
+import org.hibernate.collection.internal.PersistentBag;
+import org.hibernate.engine.spi.EntityKey;
+import org.hibernate.internal.SessionImpl;
+import org.hibernate.persister.entity.EntityPersister;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.client.application.GCField;
 import org.openbravo.client.application.GCSystem;
 import org.openbravo.client.application.GCTab;
 import org.openbravo.client.application.Parameter;
 import org.openbravo.dal.core.OBContext;
-import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.ui.Element;
 import org.openbravo.model.ad.ui.Field;
 import org.openbravo.model.ad.ui.FieldTrl;
-import org.openbravo.model.ad.ui.Tab;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Utility methods used in generating Openbravo view representations.
@@ -74,7 +74,7 @@
     Hibernate.initialize(updatedByElement.getADElementTrlList());
   }
 
-  private static Logger log = LoggerFactory.getLogger(OBViewUtil.class);
+  private static Logger log = LogManager.getLogger();
 
   /**
    * Method for retrieving the label of a field on the basis of the current language of the user.
@@ -146,8 +146,11 @@
       String primaryPropertyName, String secondaryPropertyName) {
     if (OBContext.hasTranslationInstalled()) {
       final String userLanguageId = OBContext.getOBContext().getLanguage().getId();
-      for (Object o : trlObjects) {
-        final BaseOBObject trlObject = (BaseOBObject) o;
+
+      List<BaseOBObject> initializedTrlObjects;
+      initializedTrlObjects = getInitializedTrlObjects(owner, trlObjects);
+
+      for (BaseOBObject trlObject : initializedTrlObjects) {
         final String trlLanguageId = (String) ((BaseOBObject) trlObject
             .get(FieldTrl.PROPERTY_LANGUAGE)).getId();
         if (trlLanguageId.equals(userLanguageId)) {
@@ -166,26 +169,40 @@
     return (String) owner.get(secondaryPropertyName);
   }
 
+  @SuppressWarnings("unchecked")
+  private static List<BaseOBObject> getInitializedTrlObjects(BaseOBObject owner, List<?> trlObjects) {
+    List<BaseOBObject> initializedTrlObjects;
+    // owner could have been loaded in a different DAL session via ADCS, as we are not caching trl
+    // entries in ADCS, so we need to handle this case
+    if (!Hibernate.isInitialized(trlObjects) && !OBDal.getInstance().getSession().contains(owner)) {
+      // check if there is already a different instance for the same entry in current DAL session
+      SessionImpl si = ((SessionImpl) OBDal.getInstance().getSession());
+      EntityPersister p = si.getEntityPersister(owner.getEntityName(), owner);
+      BaseOBObject ownerInSession = (BaseOBObject) si.getPersistenceContext().getEntity(
+          new EntityKey((String) owner.getId(), p));
+
+      if (ownerInSession == null) {
+        // there is no a different instance in this session, just load it
+        ownerInSession = OBDal.getInstance().get(owner.getEntityName(), owner.getId());
+      }
+
+      String propName = ((PersistentBag) trlObjects).getRole();
+      propName = propName.substring(propName.indexOf('.') + 1);
+      initializedTrlObjects = (List<BaseOBObject>) ownerInSession.get(propName);
+    } else {
+      initializedTrlObjects = (List<BaseOBObject>) trlObjects;
+    }
+    return initializedTrlObjects;
+  }
+
   /**
    * Returns the grid configuration based on the field and tab information
    * 
-   * @param tab
-   *          tab whose grid configuration is to be obtained.
    * @return the grid configuration
    */
-  public static JSONObject getGridConfigurationSettings(Tab tab) {
-    return getGridConfigurationSettings(null, tab);
-  }
-
-  /**
-   * Returns the grid configuration of a field
-   * 
-   * @param field
-   *          field whose grid configuration is to be obtained
-   * @return the grid configuration
-   */
-  public static JSONObject getGridConfigurationSettings(Field field) {
-    return getGridConfigurationSettings(field, field.getTab());
+  public static JSONObject getGridConfigurationSettings(Optional<GCSystem> sysConf,
+      Optional<GCTab> tabConf) {
+    return getGridConfigurationSettings(null, sysConf, tabConf);
   }
 
   /**
@@ -193,75 +210,39 @@
    * 
    * @param field
    *          field whose grid configuration is to be obtained it can be null
-   * @param tab
-   *          tab whose grid configuration is to be obtained. If the field is not null, this
-   *          parameter will be the tab of the field
    * @return the grid configuration
    */
-  private static JSONObject getGridConfigurationSettings(Field field, Tab tab) {
+  public static JSONObject getGridConfigurationSettings(Field field, Optional<GCSystem> sysConf,
+      Optional<GCTab> tabConf) {
     GridConfigSettings settings = new GridConfigSettings(field);
-    int gcTabIndex = 0;
-    GCTab tabConf = null;
-    if (tab.getOBUIAPPGCTabList().size() > 1) {
-      Collections.sort(tab.getOBUIAPPGCTabList(), new GCTabComparator());
-      gcTabIndex = tab.getOBUIAPPGCTabList().size() - 1;
-      tabConf = tab.getOBUIAPPGCTabList().get(gcTabIndex);
-    } else {
-      for (GCTab t : tab.getOBUIAPPGCTabList()) {
-        tabConf = t;
-        break;
+
+    if (tabConf.isPresent()) {
+      if (field != null && field.getId() != null) {
+        // Grid Configurations at field level for this tab configuration
+        // (tabConf.getOBUIAPPGCFieldList) gets cached on Hibernate's first level cache so they can
+        // be reused for all fields without the need of reach DB again
+        Optional<GCField> fieldConf = tabConf.get().getOBUIAPPGCFieldList() //
+            .stream() //
+            .filter(fieldGC -> fieldGC.getField().getId().equals(field.getId())) //
+            .findFirst();
+        if (fieldConf.isPresent()) {
+          settings.processConfig(fieldConf.get());
+        }
+      }
+
+      if (settings.shouldContinueProcessing()) {
+        // Trying to get parameters from "Grid Configuration (Tab/Field)" -> "Tab" window
+        settings.processConfig(tabConf.get());
       }
     }
 
-    if (tabConf != null && field != null && field.getId() != null) {
-      GCField fieldConf = null;
-      for (GCField fc : tabConf.getOBUIAPPGCFieldList()) {
-        // field list is cached in memory, so can be reused for all fields without the need of reach
-        // DB again
-        if (fc.getField().getId().equals(field.getId())) {
-          fieldConf = fc;
-          break;
-        }
-      }
-
-      // Trying to get parameters from "Grid Configuration (Tab/Field)" -> "Field" window
-      if (fieldConf != null) {
-        settings.processConfig(fieldConf);
-      }
-    }
-
-    if (tabConf != null && settings.shouldContinueProcessing()) {
-      // Trying to get parameters from "Grid Configuration (Tab/Field)" -> "Tab" window
-      settings.processConfig(tabConf);
-    }
-
-    if (settings.shouldContinueProcessing()) {
-      // Trying to get parameters from "Grid Configuration (System)" window
-      OBCriteria<GCSystem> gcSystemCriteria = OBDal.getInstance().createCriteria(GCSystem.class);
-      gcSystemCriteria.addOrder(Order.desc(GCTab.PROPERTY_SEQNO));
-      gcSystemCriteria.addOrder(Order.desc(GCTab.PROPERTY_ID));
-      gcSystemCriteria.setMaxResults(1);
-      List<GCSystem> sysConfs = gcSystemCriteria.list();
-
-      if (!sysConfs.isEmpty()) {
-        settings.processConfig(sysConfs.get(0));
-      }
+    if (settings.shouldContinueProcessing() && sysConf.isPresent()) {
+      settings.processConfig(sysConf.get());
     }
 
     return settings.processJSONResult();
   }
 
-  private static class GCTabComparator implements Comparator<GCTab> {
-    @Override
-    public int compare(GCTab o1, GCTab o2) {
-      if (o1.getSeqno().compareTo(o2.getSeqno()) != 0) {
-        return o1.getSeqno().compareTo(o2.getSeqno());
-      } else {
-        return o1.getId().compareTo(o2.getId());
-      }
-    }
-  }
-
   private static class GridConfigSettings {
     private Boolean canSort = null;
     private Boolean canFilter = null;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ParameterWindowComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ParameterWindowComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -41,8 +41,8 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.domain.Validation;
 import org.openbravo.model.ad.ui.Window;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * The component which takes care of creating a class for a specific paramter window.
@@ -51,7 +51,7 @@
  */
 public class ParameterWindowComponent extends BaseTemplateComponent {
   private static final String DEFAULT_TEMPLATE_ID = "FF80818132F916130132F9357DE10016";
-  private static final Logger log = LoggerFactory.getLogger(ParameterWindowComponent.class);
+  private static final Logger log = LogManager.getLogger();
 
   static final String BUTTON_LIST_REFERENCE_ID = "FF80818132F94B500132F9575619000A";
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/StandardWindowComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/StandardWindowComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -11,24 +11,37 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
 package org.openbravo.client.application.window;
 
+import static java.util.Comparator.comparing;
+import static java.util.stream.Collectors.groupingBy;
+import static java.util.stream.Collectors.toMap;
+
+import java.util.AbstractMap.SimpleEntry;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Stream;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.hibernate.criterion.Order;
+import org.openbravo.client.application.GCSystem;
+import org.openbravo.client.application.GCTab;
 import org.openbravo.client.kernel.BaseTemplateComponent;
 import org.openbravo.client.kernel.KernelConstants;
 import org.openbravo.client.kernel.Template;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
 import org.openbravo.erpCommon.obps.ActivationKey;
 import org.openbravo.erpCommon.obps.ActivationKey.FeatureRestriction;
-import org.openbravo.model.ad.ui.Field;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
 
@@ -38,12 +51,11 @@
  * @author mtaal
  */
 public class StandardWindowComponent extends BaseTemplateComponent {
-  private static final Logger log = Logger.getLogger(StandardWindowComponent.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String DEFAULT_TEMPLATE_ID = "ADD5EF45333C458098286D0E639B3290";
 
   private Window window;
   private OBViewTab rootTabComponent = null;
-  private Boolean inDevelopment = null;
   private String uniqueString = "" + System.currentTimeMillis();
   private List<String> processViews = new ArrayList<String>();
 
@@ -66,33 +78,7 @@
   }
 
   public boolean isIndevelopment() {
-    if (inDevelopment != null) {
-      return inDevelopment;
-    }
-
-    // check window, tabs and fields
-    inDevelopment = Boolean.FALSE;
-    if (window.getModule().isInDevelopment() && window.getModule().isEnabled()) {
-      inDevelopment = Boolean.TRUE;
-    } else {
-      for (Tab tab : window.getADTabList()) {
-        if (tab.isActive() && tab.getModule().isInDevelopment() && tab.getModule().isEnabled()) {
-          inDevelopment = Boolean.TRUE;
-          break;
-        }
-        for (Field field : tab.getADFieldList()) {
-          if (field.isActive() && field.getModule().isInDevelopment()
-              && field.getModule().isEnabled()) {
-            inDevelopment = Boolean.TRUE;
-            break;
-          }
-        }
-        if (inDevelopment) {
-          break;
-        }
-      }
-    }
-    return inDevelopment;
+    return adcs.isInDevelopment();
   }
 
   public String generate() {
@@ -122,6 +108,11 @@
 
   public void setWindow(Window window) {
     this.window = window;
+
+    // reset fields here to be able to use this code in testing: being request scoped will share
+    // instance if it is invoked several times in same test case.
+    rootTabComponent = null;
+    processViews = new ArrayList<>();
   }
 
   public OBViewTab getRootTabComponent() {
@@ -129,6 +120,9 @@
       return rootTabComponent;
     }
 
+    Optional<GCSystem> systemGridConfig = getSystemGridConfig();
+    Map<String, Optional<GCTab>> tabsGridConfig = getTabsGridConfig(window);
+
     final List<OBViewTab> tempTabs = new ArrayList<OBViewTab>();
     for (Tab tab : getWindow().getADTabList()) {
       // NOTE: grid sequence and field sequence tabs do not have any fields defined!
@@ -140,6 +134,7 @@
       final OBViewTab tabComponent = createComponent(OBViewTab.class);
       tabComponent.setTab(tab);
       tabComponent.setUniqueString(uniqueString);
+      tabComponent.setGCSettings(systemGridConfig, tabsGridConfig);
       tempTabs.add(tabComponent);
       final String processView = tabComponent.getProcessViews();
       if (!"".equals(processView)) {
@@ -200,4 +195,44 @@
   public List<String> getProcessViews() {
     return processViews;
   }
+
+  /** Returns the applicable System Grid Configuration if any. */
+  public static Optional<GCSystem> getSystemGridConfig() {
+    OBCriteria<GCSystem> gcSystemCriteria = OBDal.getInstance().createCriteria(GCSystem.class);
+    gcSystemCriteria.addOrder(Order.desc(GCTab.PROPERTY_SEQNO));
+    gcSystemCriteria.addOrder(Order.desc(GCTab.PROPERTY_ID));
+    gcSystemCriteria.setMaxResults(1);
+    return Optional.ofNullable((GCSystem) gcSystemCriteria.uniqueResult());
+  }
+
+  /**
+   * For a given window, it returns a Map being its key all the tab ids in that window and the
+   * values the applicable Tab Grid Configuration for each tab if any.
+   */
+  public static Map<String, Optional<GCTab>> getTabsGridConfig(Window window) {
+    // window comes from ADCS, we need to retrieve GC from DB as it might have changed
+    OBQuery<GCTab> qGCTab = OBDal.getInstance().createQuery(GCTab.class,
+        "as g where g.tab.window = :window");
+    qGCTab.setNamedParameter("window", window);
+    Map<String, List<GCTab>> gcsByTab = qGCTab.stream() //
+        .collect(groupingBy(gcTab -> gcTab.getTab().getId()));
+
+    return window.getADTabList().stream() //
+        .map(tab -> getTabConfig(tab, gcsByTab)) //
+        .collect(toMap(SimpleEntry::getKey, SimpleEntry::getValue));
+  }
+
+  private static SimpleEntry<String, Optional<GCTab>> getTabConfig(Tab tab,
+      Map<String, List<GCTab>> gcsByTab) {
+    Stream<GCTab> candidates = gcsByTab.containsKey(tab.getId()) ? gcsByTab.get(tab.getId())
+        .stream() : Stream.empty();
+
+    Optional<GCTab> selectedGC = candidates //
+        .sorted( //
+            comparing(GCTab::getSeqno) //
+                .thenComparing(GCTab::getId)) //
+        .findFirst();
+
+    return new SimpleEntry<>(tab.getId(), selectedGC);
+  }
 }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-calendar.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-calendar.js	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2013-2015 Openbravo SLU
+ * All portions are Copyright (C) 2013-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -694,7 +694,8 @@
     });
     this.calendar = isc.OBMultiCalendarCalendar.create(isc.addProperties(this.calendarProps, {
       multiCalendar: this,
-      lanes: initialLanes
+      lanes: initialLanes,
+      autoFetchData: false
     }));
 
     this.setLoading(false);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2011-2016 Openbravo SLU
+ * All portions are Copyright (C) 2011-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s): Valery Lezhebokov.
  ************************************************************************
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2010-2016 Openbravo SLU
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -2155,22 +2155,23 @@
   },
 
   redraw: function () {
-    var focusItemValue;
+    var focusItem, focusItemValue;
     this._isRedrawing = true;
+    focusItem = this.getFocusItem();
     //fetch the focus item value as it is lost sometimes during reflow. Refer issue https://issues.openbravo.com/view.php?id=24960
-    if (this.getFocusItem()) {
-      focusItemValue = this.getFocusItem().getValue();
+    if (focusItem) {
+      focusItemValue = focusItem.getValue();
     }
     this.Super('redraw', arguments);
     delete this._isRedrawing;
     //reset focus item value if lost
-    if (focusItemValue && this.getFocusItem() && this.getFocusItem().getValue() !== focusItemValue) {
-      this.getFocusItem().setValue(focusItemValue);
+    if (focusItemValue && focusItem && focusItem.getValue() !== focusItemValue) {
+      focusItem.setValue(focusItemValue);
     }
 
     // Restore the focus item if it has been deleted because it was a number and was mistaken as an UUID
-    if (this.getFocusItem() && this.getFocusItem().targetEntity !== null && (/^\d+$/).test(focusItemValue) && !this.getFocusItem().getElementValue() && (!this.getFocusItem().valueMap || !this.getFocusItem().valueMap[focusItemValue])) {
-      this.getFocusItem().setElementValue(focusItemValue);
+    if (focusItem && focusItem.targetEntity !== null && (/^\d+$/).test(focusItemValue) && !focusItem.getElementValue() && (!focusItem.valueMap || !focusItem.valueMap[focusItemValue])) {
+      focusItem.setElementValue(focusItemValue);
     }
 
     if (this.selectOnFocusStored) {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js	Tue Dec 11 12:26:44 2018 +0000
@@ -81,7 +81,7 @@
     requestProperties = requestProperties || {};
     requestProperties.clientContext = requestProperties.clientContext || {};
 
-    // only update the values of the record itself but not of any referenced 
+    // only update the values of the record itself but not of any referenced
     // entity
     if (operationType === 'update' || operationType === 'add') {
       var correctedData = {},
@@ -133,6 +133,7 @@
       sendOriginalIDBack: true,
       _extraProperties: this.getAdditionalProps()
     };
+
     isc.addProperties(newRequestProperties.params, additionalPara);
     if (!newRequestProperties.dataSource) {
       newRequestProperties.dataSource = this;
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Tue Dec 11 12:26:44 2018 +0000
@@ -1750,7 +1750,7 @@
         // session attributes of the form
         contextInfo = this.getContextInfo(false, true, true);
         this.addPreferenceValues(contextInfo, tabViewPane);
-        if (!this.isOpenedByDirectLink() && tabViewPane.showTabIf && !(tabViewPane.showTabIf(contextInfo))) {
+        if (!this.isSubtabOpenedByDirectLink() && tabViewPane.showTabIf && !(tabViewPane.showTabIf(contextInfo))) {
           this.childTabSet.tabBar.members[i].hide();
           tabViewPane.hidden = true;
         } else {
@@ -1792,10 +1792,26 @@
     }
   },
 
+  isSubtabOpenedByDirectLink: function () {
+    return this.isOpenedByDirectLink() && this.isSubTab(this.standardWindow.targetTabId);
+  },
+
   isOpenedByDirectLink: function () {
     return this.standardWindow.directTabInfo;
   },
 
+  isSubTab: function (tabId) {
+    var view;
+    if (!tabId) {
+      return false;
+    }
+    view = this.standardWindow.getView(tabId);
+    if (!view) {
+      return false;
+    }
+    return view.parentView !== null && view.parentView !== undefined;
+  },
+
   //This function returns true if it is a new record and it is being edited
   isEditingNewRecord: function () {
     var form = this.isShowingForm ? this.viewForm : this.viewGrid.getEditForm();
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2011-2017 Openbravo SLU
+ * All portions are Copyright (C) 2011-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -143,42 +143,45 @@
       editedRecord = null,
       storageBin = record.storageBin,
       i;
-  //Cheking available stock
-  if (storageBin === null) {
+  //Checking available stock
+  if (storageBin === null && !record.hasOverIssueBin) {
     item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_NotAvailableStock', [record.rMOrderNo]));
     return false;
   }
-  // check value is positive and below available qty and pending qty
-  if (value === null || value < 0 || value > record.pending || value > record.availableQty) {
-    if (record.pending < record.availableQty) {
-      item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_MoreThanPending', [record.pending]));
-    } else {
-      item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_MoreThanAvailable', [record.availableQty]));
+  if (storageBin !== null && !record.hasOverIssueBin) {
+    // check value is positive and below available qty and pending qty. 
+    // This check it is only needed if there isn't any storage bin with Overissue inventory status in the RTVS Warehouse
+    if (value === null || value < 0 || value > record.pending || value > record.availableQty) {
+      if (record.pending < record.availableQty) {
+        item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_MoreThanPending', [record.pending]));
+      } else {
+        item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_MoreThanAvailable', [record.availableQty]));
+      }
+      return false;
     }
-    return false;
-  }
-  // check shipped total quantity for the order line is below pending qty.
-  var isUomManagementEnabled = OB.PropertyStore.get('UomManagement');
-  for (i = 0; i < selectedRecordsLength; i++) {
-    editedRecord = isc.addProperties({}, selectedRecords[i], item.grid.getEditedRecord(selectedRecords[i]));
-    if (editedRecord.orderLine === orderLine) {
-      if (isUomManagementEnabled === 'Y') {
-        if (record.returnedUOM === editedRecord.returnedUOM) {
-          pendingQty -= editedRecord.movementQuantity;
-        } else {
-          var movementQuantity = new BigDecimal(String(editedRecord.movementQuantity));
-          var rate = new BigDecimal(String(editedRecord.rate));
-          pendingQty -= (editedRecord.returnedUOM !== editedRecord.uOM) ? movementQuantity.multiply(
-          rate).toString() : movementQuantity.divide(rate).toString();
+    // check shipped total quantity for the order line is below pending qty.
+    var isUomManagementEnabled = OB.PropertyStore.get('UomManagement');
+    for (i = 0; i < selectedRecordsLength; i++) {
+      editedRecord = isc.addProperties({}, selectedRecords[i], item.grid.getEditedRecord(selectedRecords[i]));
+      if (editedRecord.orderLine === orderLine) {
+        if (isUomManagementEnabled === 'Y') {
+          if (record.returnedUOM === editedRecord.returnedUOM) {
+            pendingQty -= editedRecord.movementQuantity;
+          } else {
+            var movementQuantity = new BigDecimal(String(editedRecord.movementQuantity));
+            var rate = new BigDecimal(String(editedRecord.rate));
+            pendingQty -= (editedRecord.returnedUOM !== editedRecord.uOM) ? movementQuantity.multiply(
+            rate).toString() : movementQuantity.divide(rate).toString();
+          }
         }
-      }
-      if (pendingQty < 0) {
-        if (isUomManagementEnabled === 'Y') {
-          item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_TooMuchShippedInUomManagement', []));
-        } else {
-          item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_TooMuchShipped', [record.pending]));
+        if (pendingQty < 0) {
+          if (isUomManagementEnabled === 'Y') {
+            item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_TooMuchShippedInUomManagement', []));
+          } else {
+            item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_TooMuchShipped', [record.pending]));
+          }
+          return false;
         }
-        return false;
       }
     }
   }
@@ -200,34 +203,51 @@
       editedRecord = null,
       isstocked = record.stocked,
       i;
+  //calculate already shipped qty on grid
+  var calculateAlreadyShippedQtyOnGrid = function () {
+      var isUomManagementEnabled = OB.PropertyStore.get('UomManagement');
+      for (i = 0; i < selectedRecords.length; i++) {
+        editedRecord = isc.addProperties({}, selectedRecords[i], grid.getEditedRecord(selectedRecords[i]));
+        if (editedRecord.orderLine === orderLine && selectedRecords[i].id !== record.id) {
+          if (isUomManagementEnabled === 'Y') {
+            if (record.returnedUOM === editedRecord.returnedUOM) {
+              shippedQty = shippedQty.add(new BigDecimal(String(editedRecord.movementQuantity)));
+            } else {
+              var movementQuantity = new BigDecimal(String(editedRecord.movementQuantity));
+              var rate = new BigDecimal(String(editedRecord.rate));
+              shippedQty = (editedRecord.returnedUOM !== editedRecord.uOM) ? shippedQty.add(movementQuantity.multiply(rate)) : shippedQty.add(movementQuantity.divide(rate));
+            }
+          }
+        }
+      }
+      pending = pending.subtract(shippedQty);
+      if (pending.compareTo(availableQty) < 0) {
+        record.movementQuantity = pending.toString();
+      } else {
+        record.movementQuantity = availableQty.toString();
+      }
+      };
   if (state) {
     // Checking available stock
     if (storageBin === null && isstocked) {
-      grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_NotAvailableStock', [record.rMOrderNo]));
-      return false;
-    }
-    // calculate already shipped qty on grid
-    var isUomManagementEnabled = OB.PropertyStore.get('UomManagement');
-    for (i = 0; i < selectedRecords.length; i++) {
-      editedRecord = isc.addProperties({}, selectedRecords[i], grid.getEditedRecord(selectedRecords[i]));
-      if (editedRecord.orderLine === orderLine && selectedRecords[i].id !== record.id) {
-        if (isUomManagementEnabled === 'Y') {
-          if (record.returnedUOM === editedRecord.returnedUOM) {
-            shippedQty = shippedQty.add(new BigDecimal(String(editedRecord.movementQuantity)));
+      // Check if exists any storage bin with overissue inventory status
+      var callback = function (response, data, request) {
+          if (data.overissueBin === '') {
+            grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_RM_NotAvailableStock', [record.rMOrderNo]));
+            record.hasOverIssueBin = false;
+            return false;
           } else {
-            var movementQuantity = new BigDecimal(String(editedRecord.movementQuantity));
-            var rate = new BigDecimal(String(editedRecord.rate));
-            shippedQty = (editedRecord.returnedUOM !== editedRecord.uOM) ? shippedQty.add(movementQuantity.multiply(rate)) : shippedQty.add(movementQuantity.divide(rate));
+            calculateAlreadyShippedQtyOnGrid();
+            record.hasOverIssueBin = true;
+            record.storageBin = data.overissueBin;
+            record.storageBin$_identifier = data.storageBin$_identifier;
           }
-        }
-
-      }
-    }
-    pending = pending.subtract(shippedQty);
-    if (pending.compareTo(availableQty) < 0) {
-      record.movementQuantity = pending.toString();
+          };
+      OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.CheckExistsOverissueBinForRFCShipmentWH', {
+        warehouseId: grid.view.parentWindow.activeView.getContextInfo(false, true, true, true).inpmWarehouseId
+      }, {}, callback);
     } else {
-      record.movementQuantity = availableQty.toString();
+      calculateAlreadyShippedQtyOnGrid();
     }
   }
 };
--- a/modules/org.openbravo.client.kernel/src-test/org/openbravo/client/kernel/freemarker/test/GenerateComponentTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src-test/org/openbravo/client/kernel/freemarker/test/GenerateComponentTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -33,8 +33,8 @@
 import org.openbravo.client.kernel.KernelComponentProvider;
 import org.openbravo.client.kernel.KernelConstants;
 import org.openbravo.dal.core.DalContextListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Test the generation of several kernel components.
@@ -44,7 +44,7 @@
 
 public class GenerateComponentTest extends WeldBaseTest {
 
-  private static final Logger log = LoggerFactory.getLogger(GenerateComponentTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected boolean shouldMockServletContext() {
--- a/modules/org.openbravo.client.kernel/src-test/org/openbravo/client/kernel/freemarker/test/LabelTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src-test/org/openbravo/client/kernel/freemarker/test/LabelTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -39,8 +39,8 @@
 import org.openbravo.model.ad.system.Language;
 import org.openbravo.model.ad.ui.Message;
 import org.openbravo.model.ad.ui.MessageTrl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Test the {@link I18NComponent}, test that a translated label actually is used inside of the label
@@ -51,7 +51,7 @@
 
 public class LabelTest extends WeldBaseTest {
 
-  private static final Logger log = LoggerFactory.getLogger(LabelTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   @Any
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/ApplicationDynamicComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/ApplicationDynamicComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2010-2017 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -170,4 +170,9 @@
     strVersion += OBVersion.getInstance().getMP();
     return strVersion;
   }
+
+  public String getCsrfToken() {
+    String token = (String) RequestContext.get().getSessionAttribute("#CSRF_TOKEN");
+    return token != null ? token : "";
+  }
 }
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -29,7 +29,8 @@
 import javax.inject.Inject;
 
 import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Order;
 import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
 import org.openbravo.client.kernel.BaseComponentProvider.ComponentResource;
@@ -66,14 +67,14 @@
 
   private static String moduleVersionHash = null;
 
-  private static final Logger log4j = Logger.getLogger(BaseComponent.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   @Inject
   @Any
   private Instance<Component> components;
 
   @Inject
-  private ApplicationDictionaryCachedStructures adcs;
+  protected ApplicationDictionaryCachedStructures adcs;
 
   // TODO: add the concept of child components which are generated/rendered before the root
   // component.
@@ -299,4 +300,8 @@
   public boolean bypassAuthentication() {
     return false;
   }
+
+  public ApplicationDictionaryCachedStructures getADCS() {
+    return adcs;
+  }
 }
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/CSSMinimizer.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/CSSMinimizer.java	Tue Dec 11 12:26:44 2018 +0000
@@ -45,7 +45,8 @@
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * 
@@ -65,7 +66,7 @@
  */
 class CSSMinimizer {
 
-  private static Logger log = Logger.getLogger(CSSMinimizer.class);
+  private static Logger log = LogManager.getLogger();
 
   /**
    * Minify CSS from a reader to a printstream.
@@ -167,7 +168,7 @@
   private Property[] properties = null;
   private Vector<Selector> subSelectors = null;
   private String selector;
-  private static final Logger log = Logger.getLogger(Selector.class);
+  private static final Logger log = LogManager.getLogger();
 
   /**
    * Creates a new Selector using the supplied strings.
@@ -304,7 +305,7 @@
 class Property implements Comparable<Property> {
   protected String property;
   protected Part[] parts;
-  private static final Logger log = Logger.getLogger(Property.class);
+  private static final Logger log = LogManager.getLogger();
 
   /**
    * Creates a new Property using the supplied strings. Parses out the values of the property
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/ComponentGenerator.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/ComponentGenerator.java	Tue Dec 11 12:26:44 2018 +0000
@@ -18,7 +18,8 @@
  */
 package org.openbravo.client.kernel;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.dal.core.OBContext;
 
 /**
@@ -30,7 +31,7 @@
  * @author mtaal
  */
 public class ComponentGenerator {
-  private static final Logger log = Logger.getLogger(ComponentGenerator.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static ComponentGenerator instance = new ComponentGenerator();
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/JSCompressor.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/JSCompressor.java	Tue Dec 11 12:26:44 2018 +0000
@@ -23,7 +23,8 @@
 
 import net.matthaynes.jsmin.JSMin;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.base.provider.OBProvider;
 
 /**
@@ -34,7 +35,7 @@
  * @author iperdomo
  */
 public class JSCompressor {
-  private static final Logger log = Logger.getLogger(JSCompressor.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static JSCompressor instance;
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java	Tue Dec 11 12:26:44 2018 +0000
@@ -24,8 +24,10 @@
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.client.application.report.JmxReportCache;
+import org.openbravo.client.application.window.JmxApplicationDictionaryCachedStructures;
 import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.DateTimeData;
@@ -41,7 +43,7 @@
  */
 @ApplicationScoped
 public class KernelApplicationInitializer implements ApplicationInitializer {
-  private static final Logger log4j = Logger.getLogger(KernelApplicationInitializer.class);
+  private static final Logger log4j = LogManager.getLogger();
   private static final String sqlDateTimeFormat = "DD-MM-YYYY HH24:MI:SS";
   private static final String javaDateTimeFormat = "dd-MM-yyyy HH:mm:ss";
   private static final long THRESHOLD = 5000; // 5 seconds
@@ -56,6 +58,9 @@
   @Inject
   private ApplicationDictionaryCachedStructures adCachedStructures;
 
+  @Inject
+  private JmxApplicationDictionaryCachedStructures adcsJmx;
+
   public void initialize() {
     checkDatabaseAndTomcatDateTime();
     registerMBeans();
@@ -100,6 +105,7 @@
   private void registerMBeans() {
     MBeanRegistry.registerMBean(KernelConstants.RESOURCE_COMPONENT_ID, resourceProvider);
     MBeanRegistry.registerMBean(JmxReportCache.MBEAN_NAME, reportCache);
+    MBeanRegistry.registerMBean(JmxApplicationDictionaryCachedStructures.MBEAN_NAME, adcsJmx);
   }
 
   private void setModulesAsNotInDevelopment() {
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelInitializer.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelInitializer.java	Tue Dec 11 12:26:44 2018 +0000
@@ -33,8 +33,8 @@
 import org.openbravo.dal.core.OBInterceptor;
 import org.openbravo.database.ExternalConnectionPool;
 import org.openbravo.database.PoolInterceptorProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Class responsible for initializing the kernel layer. Can be used in a servlet as well as a
@@ -45,7 +45,7 @@
 @ApplicationScoped
 public class KernelInitializer {
 
-  final static private Logger log = LoggerFactory.getLogger(KernelInitializer.class);
+  final static private Logger log = LogManager.getLogger();
 
   @Inject
   private PersistenceEventOBInterceptor persistenceEventOBInterceptor;
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelServlet.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelServlet.java	Tue Dec 11 12:26:44 2018 +0000
@@ -34,7 +34,8 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.base.ConfigParameters;
 import org.openbravo.base.HttpBaseUtils;
 import org.openbravo.base.exception.OBSecurityException;
@@ -50,8 +51,8 @@
  * @author mtaal
  */
 public class KernelServlet extends BaseKernelServlet {
-  // private static final Logger log = Logger.getLogger(DataSourceServlet.class);
-  private static final Logger log = Logger.getLogger(KernelServlet.class);
+  // private static final Logger log = LogManager.getLogger();
+  private static final Logger log = LogManager.getLogger();
 
   // this is needed to support logout deep in the code...
   // TODO: make it easier to get to the authentication manager from
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2010-2015 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -25,7 +25,8 @@
 import javax.servlet.ServletException;
 
 import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.FetchMode;
@@ -33,7 +34,10 @@
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
+import org.openbravo.base.session.SessionFactoryController;
 import org.openbravo.base.structure.BaseOBObject;
+import org.openbravo.base.weld.WeldUtils;
+import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
@@ -53,7 +57,7 @@
  * @author mtaal
  */
 public class KernelUtils {
-  private static final Logger log = Logger.getLogger(KernelUtils.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static KernelUtils instance = new KernelUtils();
 
@@ -64,6 +68,8 @@
       "org.openbravo.userinterface.smartclient", "org.openbravo.service.datasource",
       "org.openbravo.client.application", "org.openbravo.userinterface.selector" };
 
+  private ApplicationDictionaryCachedStructures adcs;
+
   public static synchronized KernelUtils getInstance() {
     if (instance == null) {
       instance = new KernelUtils();
@@ -71,6 +77,15 @@
     return instance;
   }
 
+  /** Note this constructor should not be generally used, use instead {@link #getInstance()} */
+  public KernelUtils() {
+    if (SessionFactoryController.isRunningInWebContainer()) {
+      // allow running outside Web container for tests
+      adcs = WeldUtils
+          .getInstanceFromStaticBeanManager(ApplicationDictionaryCachedStructures.class);
+    }
+  }
+
   public static synchronized void setInstance(KernelUtils instance) {
     KernelUtils.instance = instance;
   }
@@ -243,6 +258,7 @@
       // a module is returned for each module dependency, take care of this in
       // the for-loop below
       final OBCriteria<Module> modules = OBDal.getInstance().createCriteria(Module.class);
+      modules.addOrderBy(Module.PROPERTY_ID, true);
       modules.setFetchMode(Module.PROPERTY_MODULEDEPENDENCYLIST, FetchMode.JOIN);
       final List<Module> handledModules = new ArrayList<Module>();
       try {
@@ -285,6 +301,7 @@
         result.add(moduleLowLevelCode.getModule());
       }
       sortedModules = result;
+      log.debug("Modules ordered by dependency: " + sortedModules);
       return result;
     } finally {
       OBContext.restorePreviousMode();
@@ -397,7 +414,7 @@
       tabId = KernelUtilsData.getParentTab(connection, tab.getWindow().getId(), tab.getTabLevel()
           .toString(), tab.getSequenceNumber().toString());
       if (tabId != null) {
-        targetTab = OBDal.getInstance().get(Tab.class, tabId);
+        targetTab = adcs != null ? adcs.getTab(tabId) : OBDal.getInstance().get(Tab.class, tabId);
       }
     } catch (ServletException e) {
       log.error(e.getMessage(), e);
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/SessionDynamicResourceComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/SessionDynamicResourceComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -26,8 +26,8 @@
 import javax.inject.Inject;
 
 import org.openbravo.model.ad.module.Module;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This class generates other components called session dynamic resources. This kind of resources
@@ -36,7 +36,7 @@
  */
 public class SessionDynamicResourceComponent extends BaseComponent {
 
-  private static final Logger log = LoggerFactory.getLogger(SessionDynamicResourceComponent.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   @Any
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -30,7 +30,8 @@
 
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.client.kernel.BaseComponentProvider.ComponentResource;
 import org.openbravo.client.kernel.BaseComponentProvider.ComponentResource.ComponentResourceType;
@@ -45,7 +46,7 @@
  * @author iperdomo
  */
 public class StaticResourceComponent extends BaseComponent {
-  private static final Logger log = Logger.getLogger(StaticResourceComponent.class);
+  private static final Logger log = LogManager.getLogger();
 
   public static final String GEN_TARGET_LOCATION = "/web/js/gen";
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceProvider.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceProvider.java	Tue Dec 11 12:26:44 2018 +0000
@@ -28,8 +28,8 @@
 
 import javax.enterprise.context.ApplicationScoped;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This class is used as a cache for the static resources (js and css) used in the application. It
@@ -38,7 +38,7 @@
  */
 @ApplicationScoped
 public class StaticResourceProvider implements StaticResourceProviderMBean {
-  private static final Logger log = LoggerFactory.getLogger(StaticResourceProvider.class);
+  private static final Logger log = LogManager.getLogger();
 
   private String genTargetLocation;
   private ConcurrentHashMap<String, String> staticResources = new ConcurrentHashMap<>();
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -31,7 +31,8 @@
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.client.kernel.BaseComponentProvider.ComponentResource;
 import org.openbravo.client.kernel.BaseComponentProvider.ComponentResource.ComponentResourceType;
 import org.openbravo.model.ad.module.Module;
@@ -43,7 +44,7 @@
  * @author iperdomo
  */
 public class StyleSheetResourceComponent extends BaseComponent {
-  private static final Logger log = Logger.getLogger(StyleSheetResourceComponent.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String IMGURLHOLDER = "__URLHOLDER__";
 
   protected static final String CSS = "CSS";
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/TemplateResolver.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/TemplateResolver.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -48,7 +49,7 @@
  * @see Template#getOverridesTemplate()
  */
 public class TemplateResolver {
-  private static final Logger log = Logger.getLogger(TemplateResolver.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static TemplateResolver instance = new TemplateResolver();
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/TestActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/TestActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 
 import javax.enterprise.context.ApplicationScoped;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 
 /**
@@ -33,7 +34,7 @@
  */
 @ApplicationScoped
 public class TestActionHandler extends BaseActionHandler {
-  private static final Logger log = Logger.getLogger(TestActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
 
   protected JSONObject execute(Map<String, Object> parameters, String data) {
     log.debug(">>>>>>>>>>>>>>> Received ActionHandler request ");
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/CharacteristicsUIDefinition.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/CharacteristicsUIDefinition.java	Tue Dec 11 12:26:44 2018 +0000
@@ -22,7 +22,8 @@
 import java.util.List;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
@@ -43,7 +44,7 @@
 
 public class CharacteristicsUIDefinition extends TextUIDefinition {
 
-  private static final Logger log4j = Logger.getLogger(CharacteristicsUIDefinition.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   @Override
   public String getFormEditorType() {
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/FKComboUIDefinition.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/FKComboUIDefinition.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2010-2014 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,6 +21,7 @@
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBException;
+import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
 import org.openbravo.client.kernel.KernelUtils;
 import org.openbravo.dal.core.DalUtil;
@@ -88,18 +89,12 @@
 
   /* Returns true if the identifier of the table is composed of more than one column */
   private Boolean isTableWithMultipleIdentifierColumns(Table relatedTable) {
-    int nIdentifiers = 0;
-    for (Column curColumn : relatedTable.getADColumnList()) {
-      if (curColumn.isIdentifier()) {
-        nIdentifiers += 1;
-        if (nIdentifiers > 1) {
-          // if there is more than one identifier return true
-          return true;
-        }
-      }
-    }
-    // there is only one identifier column
-    return false;
+    return ModelProvider.getInstance() //
+        .getTable(relatedTable.getDBTableName()) //
+        .getColumns() //
+        .stream() //
+        .filter(org.openbravo.base.model.Column::isIdentifier) //
+        .count() > 1;
   }
 
   private boolean isPropertyField(Field field) {
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2010-2017 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,9 +28,11 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -41,6 +43,8 @@
 import org.openbravo.base.model.domaintype.PrimitiveDomainType;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.base.weld.WeldUtils;
+import org.openbravo.client.application.GCSystem;
+import org.openbravo.client.application.GCTab;
 import org.openbravo.client.application.Parameter;
 import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
 import org.openbravo.client.application.window.OBViewUtil;
@@ -70,7 +74,7 @@
   private Reference reference;
   private DomainType domainType;
   private JSONObject gridConfigurationSettings;
-  protected static final Logger log = Logger.getLogger(UIDefinition.class);
+  protected static final Logger log = LogManager.getLogger();
 
   /**
    * Unique name used to identify the type.
@@ -558,9 +562,13 @@
    * 
    * @param field
    *          the field for which the information should be computed.
+   * @param systemGC
+   * @param tabGC
    */
-  public void establishGridConfigurationSettings(Field field) {
-    this.gridConfigurationSettings = OBViewUtil.getGridConfigurationSettings(field);
+  public void establishGridConfigurationSettings(Field field, Optional<GCSystem> systemGC,
+      Optional<GCTab> tabGC) {
+    this.gridConfigurationSettings = OBViewUtil
+        .getGridConfigurationSettings(field, systemGC, tabGC);
   }
 
   // note can make sense to also enable hover of values for enums
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinitionController.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinitionController.java	Tue Dec 11 12:26:44 2018 +0000
@@ -23,7 +23,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.dom4j.Document;
 import org.dom4j.Element;
 import org.hibernate.Hibernate;
@@ -47,7 +48,7 @@
  * @author mtaal
  */
 public class UIDefinitionController extends BaseTemplateComponent {
-  private static final Logger log = Logger.getLogger(UIDefinitionController.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final String TEMPORARY_DECIMAL_REPLACE = ";;;";
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/templates/application-dynamic-js.ftl	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/templates/application-dynamic-js.ftl	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2009-2017 Openbravo SLU
+ * All portions are Copyright (C) 2009-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -51,7 +51,8 @@
         writableOrganizations: [
         <#list data.writableOrganizations as property>
             '${property?js_string}'<#if property_has_next>,</#if>
-        </#list>]
+        </#list>],
+        csrfToken: '${data.csrfToken?js_string}'
 };
 
 OB.AccessibleEntities = {
--- a/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOBUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOBUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,7 +25,8 @@
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -49,7 +50,7 @@
  */
 @ApplicationScoped
 public class MyOBUtils {
-  private static Logger log = Logger.getLogger(MyOBUtils.class);
+  private static Logger log = LogManager.getLogger();
   private static String MENU_ITEM_IS_SEPARATOR = "isSeparator";
   private static String MENU_ITEM_TITLE = "title";
   private static String MENU_ITEM_CLICK = "click";
--- a/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -26,7 +26,8 @@
 import javax.inject.Inject;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -54,7 +55,7 @@
 
 @ApplicationScoped
 public class MyOpenbravoActionHandler extends BaseActionHandler implements PortalAccessible {
-  private static final Logger log = Logger.getLogger(MyOpenbravoActionHandler.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String WIDGET_MOVED = "WIDGET_MOVED";
   private static final String WIDGET_ADDED = "WIDGET_ADDED";
   private static final String WIDGET_REMOVED = "WIDGET_REMOVED";
--- a/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -27,7 +27,8 @@
 import javax.inject.Inject;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
@@ -55,7 +56,7 @@
   static final String COMPONENT_ID = "MyOpenbravo";
   private static final String TEMPLATEID = "CA8047B522B44F61831A8CAA3AE2A7CD";
 
-  private Logger log = Logger.getLogger(MyOpenbravoComponent.class);
+  private Logger log = LogManager.getLogger();
 
   @Inject
   private MyOBUtils myOBUtils;
--- a/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/URLWidgetProvider.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/URLWidgetProvider.java	Tue Dec 11 12:26:44 2018 +0000
@@ -18,7 +18,8 @@
  */
 package org.openbravo.client.myob;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.NonUniqueResultException;
@@ -32,7 +33,7 @@
  * @author mtaal
  */
 public class URLWidgetProvider extends WidgetProvider {
-  private static final Logger log = Logger.getLogger(URLWidgetProvider.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final String URLWIDGETCLASSNAME = "OBUrlWidget";
   private static final String SRC = "src";
--- a/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/WidgetProvider.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/WidgetProvider.java	Tue Dec 11 12:26:44 2018 +0000
@@ -29,7 +29,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.query.Query;
@@ -66,7 +67,7 @@
  * @author mtaal
  */
 public abstract class WidgetProvider {
-  private static final Logger log = Logger.getLogger(WidgetProvider.class);
+  private static final Logger log = LogManager.getLogger();
 
   public static final String WIDGETCLASSID = "widgetClassId";
   public static final String TITLE = "title";
--- a/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/widgetinform/WidgetInFormUIDefinition.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/widgetinform/WidgetInFormUIDefinition.java	Tue Dec 11 12:26:44 2018 +0000
@@ -18,7 +18,8 @@
  */
 package org.openbravo.client.myob.widgetinform;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.client.kernel.reference.UIDefinition;
@@ -35,7 +36,7 @@
  */
 public class WidgetInFormUIDefinition extends UIDefinition {
 
-  private static Logger widgetLog = Logger.getLogger(WidgetInFormUIDefinition.class);
+  private static Logger widgetLog = LogManager.getLogger();
 
   @Override
   public String getFormEditorType() {
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java	Tue Dec 11 12:26:44 2018 +0000
@@ -38,7 +38,8 @@
 import javax.persistence.TupleElement;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -89,7 +90,7 @@
  */
 public class QueryListDataSource extends ReadOnlyDataSourceService implements PortalAccessible {
   private static final String OPTIONAL_FILTERS = "@optional_filters@";
-  private static final Logger log = Logger.getLogger(QueryListDataSource.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String OPERATOR = "$OPERATOR";
 
   @Override
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
@@ -39,7 +40,7 @@
 import org.openbravo.model.ad.ui.Tab;
 
 class QueryListUtils {
-  private static final Logger log = Logger.getLogger(QueryListUtils.class);
+  private static final Logger log = LogManager.getLogger();
 
   public static String getWidgetClassFields(WidgetClass widgetClass, IncludeIn includeIn) {
     try {
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListWidgetProvider.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListWidgetProvider.java	Tue Dec 11 12:26:44 2018 +0000
@@ -23,7 +23,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.client.application.Parameter;
@@ -46,7 +47,7 @@
   public static final String WIDGETCLASS_PARAMETER = "WIDGET_CLASS";
 
   private static final String GRID_PROPERTIES_REFERENCE = "B36DF126DF5F4077A37F1E5B963AA636";
-  private static final Logger log = Logger.getLogger(QueryListWidgetProvider.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   @ComponentProvider.Qualifier(DataSourceConstants.DS_COMPONENT_TYPE)
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Tue Dec 11 12:26:44 2018 +0000
@@ -35,7 +35,8 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.LockOptions;
 import org.hibernate.ScrollMode;
 import org.hibernate.ScrollableResults;
@@ -56,7 +57,6 @@
 import org.openbravo.data.FieldProvider;
 import org.openbravo.erpCommon.utility.FieldProviderFactory;
 import org.openbravo.erpCommon.utility.SQLReturnObject;
-import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.datamodel.Column;
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.domain.List;
@@ -83,7 +83,7 @@
 public class PaymentReportDao {
 
   private static final long milisecDayConv = (1000 * 60 * 60 * 24);
-  static Logger log4j = Logger.getLogger(Utility.class);
+  static Logger log4j = LogManager.getLogger();
   private java.util.List<String> bpList;
   private java.util.List<String> bpCategoryList;
   private java.util.List<String> projectList;
--- a/modules/org.openbravo.service.datasource/src-test/org/openbravo/service/datasource/test/DataSourceJavaScriptTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src-test/org/openbravo/service/datasource/test/DataSourceJavaScriptTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -24,7 +24,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.Test;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -45,7 +46,7 @@
  * @author mtaal
  */
 public class DataSourceJavaScriptTest extends WeldBaseTest {
-  private static final Logger log = Logger.getLogger(DataSourceJavaScriptTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Inject
   private DataSourceServiceProvider dataSourceServiceProvider;
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -60,11 +60,11 @@
 import org.openbravo.service.json.DataResolvingMode;
 import org.openbravo.service.json.DataToJsonConverter;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class ADTreeDatasourceService extends TreeDatasourceService {
-  private static final Logger logger = LoggerFactory.getLogger(ADTreeDatasourceService.class);
+  private static final Logger logger = LogManager.getLogger();
   private static final String AD_MENU_TABLE_ID = "116";
   private static final String AD_ORG_TABLE_ID = "155";
   private static final int PARENT_ID = 1;
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/AccountTreeDatasourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/AccountTreeDatasourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -29,15 +29,15 @@
 import org.openbravo.model.ad.utility.TableTree;
 import org.openbravo.model.ad.utility.Tree;
 import org.openbravo.model.financialmgmt.accounting.coa.Element;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Tree Datasource for Account Tree
  * 
  */
 public class AccountTreeDatasourceService extends ADTreeDatasourceService {
-  private static final Logger logger = LoggerFactory.getLogger(AccountTreeDatasourceService.class);
+  private static final Logger logger = LogManager.getLogger();
   private static final String DATASOURCE_ID = "D2F94DC86DEC48D69E4BFCE59DC670CF";
   private static final String C_ELEMENTVALUE_TABLE_ID = "188";
   private static final String FINANCIALMGMTELEMENT_ID = "@FinancialMgmtElement.id@";
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/BaseDataSourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/BaseDataSourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,7 +25,8 @@
 import javax.inject.Inject;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.base.exception.OBSecurityException;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -48,7 +49,7 @@
  * @author mtaal
  */
 public abstract class BaseDataSourceService implements DataSourceService {
-  private static final Logger log = Logger.getLogger(BaseDataSourceService.class);
+  private static final Logger log = LogManager.getLogger();
 
   private String name;
   private Template template;
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ComboTableDatasourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ComboTableDatasourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -41,8 +41,8 @@
 import org.openbravo.model.ad.ui.Field;
 import org.openbravo.service.db.DalConnectionProvider;
 import org.openbravo.service.json.JsonConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * The implementation of the combo table reference datasource.
@@ -51,7 +51,7 @@
  */
 
 public class ComboTableDatasourceService extends BaseDataSourceService {
-  private static final Logger log = LoggerFactory.getLogger(ComboTableDatasourceService.class);
+  private static final Logger log = LogManager.getLogger();
 
   /*
    * (non-Javadoc)
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java	Tue Dec 11 12:26:44 2018 +0000
@@ -35,6 +35,8 @@
 import java.util.Map;
 import java.util.TimeZone;
 import java.util.Vector;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import javax.inject.Inject;
 import javax.servlet.ServletConfig;
@@ -43,7 +45,8 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -108,11 +111,13 @@
  * @author mtaal
  */
 public class DataSourceServlet extends BaseKernelServlet {
-  private static final Logger log = Logger.getLogger(DataSourceServlet.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final long serialVersionUID = 1L;
 
   private static String servletPathPart = "org.openbravo.service.datasource";
+  private static Pattern csrfTokenPattern = Pattern
+      .compile("\"csrfToken\":\"(?<token>[A-Z0-9]+)\"");
 
   public static String getServletPathPart() {
     return servletPathPart;
@@ -847,9 +852,12 @@
         throw new OBUserException("AccessTableNoView");
       }
 
+      String content = getRequestContent(request);
+
+      checkCsrfToken(getCsrfTokenFromRequestContent(content), request);
+
       // note if clause updates parameter map
       if (checkSetIDDataSourceName(request, response, parameters)) {
-        String content = getRequestContent(request);
         parameters.put(DataSourceConstants.ADD_CONTENT_OPERATION, content);
         getDataSource(request).checkEditDatasourceAccess(parameters);
         final String result = getDataSource(request).add(parameters, content);
@@ -873,6 +881,8 @@
         throw new OBUserException("AccessTableNoView");
       }
 
+      checkCsrfToken(parameters.get(JsonConstants.CSRF_TOKEN_PARAMETER), request);
+
       final String id = parameters.get(JsonConstants.ID);
       if (id == null) {
         throw new InvalidRequestException("No id parameter");
@@ -911,10 +921,14 @@
         throw new OBUserException("AccessTableNoView");
       }
 
+      String requestContent = getRequestContent(request);
+
+      checkCsrfToken(getCsrfTokenFromRequestContent(requestContent), request);
+
       // note if clause updates parameter map
       if (checkSetIDDataSourceName(request, response, parameters)) {
         getDataSource(request).checkEditDatasourceAccess(parameters);
-        final String result = getDataSource(request).update(parameters, getRequestContent(request));
+        final String result = getDataSource(request).update(parameters, requestContent);
         writeResult(response, result);
       }
 
@@ -923,6 +937,35 @@
     }
   }
 
+  private void checkCsrfToken(String requestToken, HttpServletRequest request) {
+    String sessionToken = getSessionCsrfToken(request);
+    if (!hasValidCsrfToken(requestToken, sessionToken)) {
+      log.error("CSRF token check failed. Request=" + request.getRequestURI() + ", SessionID="
+          + request.getSession(false).getId() + ", SessionToken=" + sessionToken
+          + ", RequestToken=" + requestToken);
+      throw new OBUserException("InvalidCSRFToken");
+    }
+  }
+
+  private boolean hasValidCsrfToken(String requestToken, String sessionToken) {
+    return StringUtils.isNotEmpty(requestToken) && StringUtils.isNotEmpty(sessionToken)
+        && requestToken.equals(sessionToken);
+  }
+
+  private String getCsrfTokenFromRequestContent(String requestContent) {
+    Matcher matcher = csrfTokenPattern.matcher(requestContent);
+    if (matcher.find()) {
+      return matcher.group("token");
+    }
+
+    return "";
+  }
+
+  private String getSessionCsrfToken(HttpServletRequest request) {
+    String token = (String) request.getSession(false).getAttribute("#CSRF_TOKEN");
+    return token != null ? token : "";
+  }
+
   private boolean checkSetParameters(HttpServletRequest request, HttpServletResponse response,
       Map<String, String> parameters) throws IOException {
     if (!request.getRequestURI().contains("/" + servletPathPart)) {
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -29,8 +29,8 @@
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This class contains utility methods for dataSource related classes
@@ -38,7 +38,7 @@
  */
 public class DataSourceUtils {
 
-  private static final Logger log = LoggerFactory.getLogger(DataSourceUtils.class);
+  private static final Logger log = LogManager.getLogger();
 
   /**
    * Returns a comma separated list of organization ids to filter the HQL. If an organization id is
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -27,7 +27,8 @@
 import javax.inject.Inject;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBSecurityException;
@@ -64,7 +65,7 @@
  * @author mtaal
  */
 public class DefaultDataSourceService extends BaseDataSourceService {
-  private static final Logger log4j = Logger.getLogger(DefaultDataSourceService.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   @Inject
   private CachedPreference cachedPreference;
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -43,6 +43,7 @@
 import org.openbravo.base.model.domaintype.PrimitiveDomainType;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.base.structure.IdentifierProvider;
+import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.client.kernel.reference.EnumUIDefinition;
 import org.openbravo.client.kernel.reference.ForeignKeyUIDefinition;
@@ -63,13 +64,13 @@
 import org.openbravo.service.json.AdvancedQueryBuilder;
 import org.openbravo.service.json.JsonConstants;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class HQLDataSourceService extends ReadOnlyDataSourceService {
   public static final String PROPERTY_FIELD_SEPARATOR = "___";
 
-  private static final Logger log = LoggerFactory.getLogger(HQLDataSourceService.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String AND = " AND ";
   private static final String WHERE = " WHERE ";
   private static final String ORDERBY = " ORDER BY ";
@@ -84,10 +85,14 @@
   @Inject
   @Any
   private Instance<HqlInserter> hqlInserters;
+
   @Inject
   @Any
   private Instance<HqlQueryTransformer> hqlQueryTransformers;
 
+  @Inject
+  private ApplicationDictionaryCachedStructures adcs;
+
   @Override
   public List<DataSourceProperty> getDataSourceProperties(Map<String, Object> parameters) {
     // Returns the datasource properties, based on the columns of the table that is going to use the
@@ -96,7 +101,7 @@
     List<DataSourceProperty> dataSourceProperties = new ArrayList<>();
     String tableId = (String) parameters.get("tableId");
     if (tableId != null) {
-      Table table = OBDal.getInstance().get(Table.class, tableId);
+      Table table = adcs.getTable(tableId);
       Entity entity = ModelProvider.getInstance().getEntityByTableId(tableId);
       for (Column column : table.getADColumnList()) {
         final DataSourceProperty dsProperty = new DataSourceProperty();
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -53,12 +53,11 @@
 import org.openbravo.service.json.DataResolvingMode;
 import org.openbravo.service.json.DataToJsonConverter;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class LinkToParentTreeDatasourceService extends TreeDatasourceService {
-  private static final Logger logger = LoggerFactory
-      .getLogger(LinkToParentTreeDatasourceService.class);
+  private static final Logger logger = LogManager.getLogger();
   private static final String ID_SEPARATOR = "-";
 
   @Override
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ModelDataSourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ModelDataSourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -25,7 +25,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -47,7 +48,7 @@
   private static final String DATASOURCE_FIELD = "property";
   private static final String FORM_FIELD = "inpadTableId";
 
-  private static final Logger log = Logger.getLogger(ModelDataSourceService.class);
+  private static final Logger log = LogManager.getLogger();
   private static final Property identifier = new Property();
 
   static {
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/NoteDataSource.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/NoteDataSource.java	Tue Dec 11 12:26:44 2018 +0000
@@ -35,8 +35,8 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * A data source for the notes which manages the security. Checks if a user has access to the record
@@ -46,7 +46,7 @@
  * 
  */
 public class NoteDataSource extends DefaultDataSourceService {
-  private static final Logger log = LoggerFactory.getLogger(NoteDataSource.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   public String fetch(Map<String, String> parameters) {
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ReadOnlyDataSourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ReadOnlyDataSourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -34,8 +34,8 @@
 import org.openbravo.service.json.DefaultJsonDataService.QueryResultWriter;
 import org.openbravo.service.json.JsonConstants;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * The SimpleDataSourceService provides a simple way of returning data in the correct format for a
@@ -44,7 +44,7 @@
  * @author mtaal
  */
 public abstract class ReadOnlyDataSourceService extends DefaultDataSourceService {
-  private static final Logger log = LoggerFactory.getLogger(ReadOnlyDataSourceService.class);
+  private static final Logger log = LogManager.getLogger();
   private static final int MAX_PAGE_SIZE_INCREASE = 3;
   private static final String NEW_END_ROW = "_newEndRow";
 
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -58,8 +58,8 @@
 import org.openbravo.service.db.DalConnectionProvider;
 import org.openbravo.service.json.JsonConstants;
 import org.openbravo.service.json.JsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * The TreeDatasourceService is an abstract class that provides a simple way of returning data in
@@ -67,7 +67,7 @@
  * 
  */
 public abstract class TreeDatasourceService extends DefaultDataSourceService {
-  private static final Logger log = LoggerFactory.getLogger(TreeDatasourceService.class);
+  private static final Logger log = LogManager.getLogger();
   private static final String JSON_PREFIX = "<SCRIPT>//'\"]]>>isc_JSONResponseStart>>";
   private static final String JSON_SUFFIX = "//isc_JSONResponseEnd";
   protected static final String ROOT_NODE_DB = "0";
--- a/modules/org.openbravo.service.datasource/web/org.openbravo.service.datasource/js/ob-datasource-utilities.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.datasource/web/org.openbravo.service.datasource/js/ob-datasource-utilities.js	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2009-2016 Openbravo SLU
+ * All portions are Copyright (C) 2009-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -183,6 +183,8 @@
 });
 
 isc.OBRestDataSource.addProperties({
+  csrfToken: OB.User.csrfToken,
+
   sendDSRequest: function (dsRequest) {
     //TODO: Report an issue to SmartClient - This part is a work around
     var extraProperties = {};
@@ -206,6 +208,30 @@
     this.Super('sendDSRequest', arguments);
   },
 
+  transformRequest: function (dsRequest) {
+    var operationType = dsRequest.operationType;
+
+    if (this.csrfToken && operationType === 'remove') {
+      dsRequest.params.csrfToken = this.csrfToken;
+    }
+
+    //
+    // Request body parameters are generated from an object created in RestDataSource.transformRequest
+    // and there is no way to modify this object to add a new field.
+    // For this reason the resulting string-encoded body from RestDataSource is decoded as JSON
+    // to add the CSRF token and then it is encoded again as a JSON string.
+    //
+    var encodedParams = this.Super('transformRequest', arguments);
+
+    if (this.csrfToken && (operationType === 'add' || operationType === 'update')) {
+      var decodedParams = isc.JSON.decode(encodedParams);
+      decodedParams.csrfToken = this.csrfToken;
+      encodedParams = isc.JSON.encode(decodedParams);
+    }
+
+    return encodedParams;
+  },
+
   // always let the dummy criterion be true
   evaluateCriterion: function (record, criterion) {
     if (criterion && criterion.fieldName && criterion.fieldName === isc.OBRestDataSource.DUMMY_CRITERION_NAME) {
--- a/modules/org.openbravo.service.json/src-test/org/openbravo/service/json/test/JsonConversionTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src-test/org/openbravo/service/json/test/JsonConversionTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -30,7 +30,8 @@
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.CallbackException;
 import org.hibernate.EmptyInterceptor;
@@ -64,7 +65,7 @@
  */
 
 public class JsonConversionTest extends OBBaseTest {
-  private static final Logger log = Logger.getLogger(JsonConversionTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   /**
    * Read one BaseOBObject and convert to json and back to the object again.
--- a/modules/org.openbravo.service.json/src-test/org/openbravo/service/json/test/JsonRestTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src-test/org/openbravo/service/json/test/JsonRestTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -30,7 +30,8 @@
 import java.net.PasswordAuthentication;
 import java.net.URL;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.service.json.JsonRestServlet;
@@ -43,7 +44,7 @@
  * @author mtaal
  */
 public class JsonRestTest extends OBBaseTest {
-  private static final Logger log = Logger.getLogger(JsonRestTest.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final String OB_URL = "http://localhost:8080/openbravo";
   private static final String LOGIN = "Openbravo";
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataEntityQueryService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataEntityQueryService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2009-2016 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2018 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,9 +21,10 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
+import java.util.stream.Collectors;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.ScrollMode;
@@ -54,7 +55,7 @@
  * @author mtaal
  */
 public class DataEntityQueryService {
-  private static final Logger log = Logger.getLogger(DataEntityQueryService.class);
+  private static final Logger log = LogManager.getLogger();
 
   public static final String PARAM_DELIMITER = "@";
 
@@ -151,14 +152,12 @@
     }
     obq.setFilterOnActive(isFilterOnActive());
 
-    if (log.isDebugEnabled()) {
-      String params = "";
-      Map<String, Object> namedParams = queryBuilder.getNamedParameters();
-      for (String paramName : namedParams.keySet()) {
-        params += "  -" + paramName + ": " + namedParams.get(paramName) + "\n";
-      }
-      log.debug("Setting params:\n" + params);
-    }
+    log.debug("Setting params:\n{}", ()->
+      queryBuilder.getNamedParameters().entrySet().stream()
+        .map(e -> "  -" + e.getKey() + ": " + e.getValue())
+        .collect(Collectors.joining("\n"))
+    );
+
     obq.setNamedParameters(queryBuilder.getNamedParameters());
 
     return obq;
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Tue Dec 11 12:26:44 2018 +0000
@@ -47,8 +47,8 @@
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Is responsible for converting Openbravo business objects ({@link BaseOBObject} to a json
@@ -89,7 +89,7 @@
   // BaseOBObjects from which to infer the entity
   private Entity entity;
 
-  private static final Logger log = LoggerFactory.getLogger(DataToJsonConverter.class);
+  private static final Logger log = LogManager.getLogger();
 
   /**
    * Convert a list of Maps with key value pairs to a list of {@link JSONObject}.
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Tue Dec 11 12:26:44 2018 +0000
@@ -31,7 +31,8 @@
 import javax.inject.Inject;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -78,7 +79,7 @@
  * @author mtaal
  */
 public class DefaultJsonDataService implements JsonDataService {
-  private static final Logger log = Logger.getLogger(DefaultJsonDataService.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final String ADD_FLAG = "_doingAdd";
   private static final int DEFAULT_ID_LENGTH = 32;
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonConstants.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonConstants.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2009-2017 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2018 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -73,6 +73,7 @@
   public static final String TEXTMATCH_STARTSWITH = "startsWith";
   public static final String TEXTMATCH_SUBSTRING = "substring";
   public static final String DISPLAYFIELD_PARAMETER = "displayProperty";
+  public static final String CSRF_TOKEN_PARAMETER = "csrfToken";
 
   // if this parameter is passed then if a new object already has an id then
   // that id is set back in the json which is returned together with the
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonRestServlet.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonRestServlet.java	Tue Dec 11 12:26:44 2018 +0000
@@ -31,7 +31,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -56,7 +57,7 @@
  * @author mtaal
  */
 public class JsonRestServlet extends BaseWebServiceServlet {
-  private static final Logger log = Logger.getLogger(JsonRestServlet.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final long serialVersionUID = 1L;
 
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java	Tue Dec 11 12:26:44 2018 +0000
@@ -34,7 +34,8 @@
 import javax.servlet.ServletException;
 
 import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -117,7 +118,7 @@
  * @author mtaal
  */
 public class JsonToDataConverter {
-  private static final Logger log = Logger.getLogger(JsonToDataConverter.class);
+  private static final Logger log = LogManager.getLogger();
 
   private static final String DOT = ".";
 
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java	Tue Dec 11 12:26:44 2018 +0000
@@ -26,7 +26,8 @@
 import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -54,7 +55,7 @@
  * @author mtaal
  */
 public class JsonUtils {
-  private static final Logger log = Logger.getLogger(JsonUtils.class);
+  private static final Logger log = LogManager.getLogger();
 
   /** PG returns this SQL state when query time out occurs */
   private static final String PG_QUERY_CANCELED = "57014";
--- a/modules/org.openbravo.userinterface.selector/src-test/org/openbravo/userinterface/selectors/test/ExpressionsTest.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.selector/src-test/org/openbravo/userinterface/selectors/test/ExpressionsTest.java	Tue Dec 11 12:26:44 2018 +0000
@@ -27,7 +27,8 @@
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.Before;
 import org.junit.Test;
 import org.openbravo.client.application.OBBindings;
@@ -44,7 +45,7 @@
   private ScriptEngineManager manager;
   private ScriptEngine engine;
   private Object result = null;
-  private Logger log = Logger.getLogger(ExpressionsTest.class);
+  private Logger log = LogManager.getLogger();
 
   private HashMap<String, String> expr = new HashMap<String, String>();
 
--- a/modules/org.openbravo.userinterface.selector/src-util/modulescript/src/org/openbravo/userinterface/selector/UpdateLanguageColumn.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.selector/src-util/modulescript/src/org/openbravo/userinterface/selector/UpdateLanguageColumn.java	Tue Dec 11 12:26:44 2018 +0000
@@ -20,7 +20,8 @@
 
 import java.sql.Statement;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.modulescript.ModuleScript;
 import org.openbravo.modulescript.ModuleScriptExecutionLimits;
@@ -28,7 +29,7 @@
 
 public class UpdateLanguageColumn extends ModuleScript {
 
-  private static final Logger log4j = Logger.getLogger(UpdateLanguageColumn.class);
+  private static final Logger log4j = LogManager.getLogger();
 
   @Override
   // obuisel_selector_field_trl table have & must use ad_language column instead of ad_language_id
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java	Tue Dec 11 12:26:44 2018 +0000
@@ -36,7 +36,8 @@
 import javax.persistence.TupleElement;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -66,7 +67,7 @@
 
 public class CustomQuerySelectorDatasource extends ReadOnlyDataSourceService {
 
-  private static Logger log = Logger.getLogger(CustomQuerySelectorDatasource.class);
+  private static Logger log = LogManager.getLogger();
   private static final String ADDITIONAL_FILTERS = "@additional_filters@";
   private static final String NEW_FILTER_CLAUSE = "\n AND ";
   private static final String NEW_OR_FILTER_CLAUSE = "\n OR ";
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorComponent.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorComponent.java	Tue Dec 11 12:26:44 2018 +0000
@@ -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) 2009-2017 Openbravo SLU
+ * All portions are Copyright (C) 2009-2018 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -30,7 +30,8 @@
 import javax.inject.Inject;
 
 import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Criterion;
@@ -99,7 +100,7 @@
   private static OutSelectorField IdentifierOutField;
   private String transformedColumnName = null;
 
-  private static Logger log = Logger.getLogger(SelectorComponent.class);
+  private static Logger log = LogManager.getLogger();
 
   static {
     IdOutField = new OutSelectorField();
@@ -474,7 +475,7 @@
    * fields
    */
   private List<Field> getOutFieldListForSelectorField(String tabId, String selectorFieldId) {
-    Tab tab = OBDal.getInstance().get(Tab.class, tabId);
+    Tab tab = adcs.getTab(tabId);
     List<Field> tabFields = tab.getADFieldList();
     List<Field> result = new ArrayList<Field>();
     for (Field f : tabFields) {
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDataSourceFilter.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDataSourceFilter.java	Tue Dec 11 12:26:44 2018 +0000
@@ -30,7 +30,8 @@
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.exception.OBSecurityException;
@@ -64,7 +65,7 @@
  */
 public class SelectorDataSourceFilter implements DataSourceFilter {
 
-  private static Logger log = Logger.getLogger(SelectorDataSourceFilter.class);
+  private static Logger log = LogManager.getLogger();
   private String dateFormat = null;
   private DateFormat systemDateFormat = null;
   private TextMatching textMatching = TextMatching.exact;
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDefaultFilterActionHandler.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDefaultFilterActionHandler.java	Tue Dec 11 12:26:44 2018 +0000
@@ -27,7 +27,8 @@
 import javax.enterprise.context.ApplicationScoped;
 import javax.servlet.http.HttpSession;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -53,7 +54,7 @@
  */
 @ApplicationScoped
 public class SelectorDefaultFilterActionHandler extends BaseActionHandler {
-  private Logger log = Logger.getLogger(SelectorDefaultFilterActionHandler.class);
+  private Logger log = LogManager.getLogger();
 
   @Override
   protected JSONObject execute(Map<String, Object> parameters, String content) {
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/model/domaintype/SelectorDomainType.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/model/domaintype/SelectorDomainType.java	Tue Dec 11 12:26:44 2018 +0000
@@ -21,7 +21,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.Session;
 import org.hibernate.query.Query;
 import org.openbravo.base.model.Column;
@@ -36,7 +37,7 @@
  * @author mtaal
  */
 public class SelectorDomainType extends BaseForeignKeyDomainType {
-  private static final Logger log = Logger.getLogger(SelectorDomainType.class);
+  private static final Logger log = LogManager.getLogger();
 
   private Column column;
   private String tableName;
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-util/modulescript/src/src/org/openbravo/userinterface/skin/s250to300Comp/modulescript/DefaultSkinData.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-util/modulescript/src/src/org/openbravo/userinterface/skin/s250to300Comp/modulescript/DefaultSkinData.java	Tue Dec 11 12:26:44 2018 +0000
@@ -3,7 +3,8 @@
 
 import java.sql.*;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.servlet.ServletException;
 
@@ -12,7 +13,7 @@
 import org.openbravo.data.UtilSql;
 
 class DefaultSkinData implements FieldProvider {
-static Logger log4j = Logger.getLogger(DefaultSkinData.class);
+static Logger log4j = LogManager.getLogger();
   private String InitRecordNumber="0";
   public String t;
 
--- a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Tue Dec 11 12:26:44 2018 +0000
@@ -792,7 +792,7 @@
     }
   },
 
-  parseErrorMessage: function(response) {
+  parseErrorMessage: function (response) {
     if (response.httpResponseText) {
       var jsonResponse = JSON.parse(response.httpResponseText);
       if (jsonResponse.response && jsonResponse.response.error && jsonResponse.response.error.message) {
--- a/modules/org.openbravo.utility.cleanup.log/src/org/openbravo/utility/cleanup/log/CleanEntity.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.utility.cleanup.log/src/org/openbravo/utility/cleanup/log/CleanEntity.java	Tue Dec 11 12:26:44 2018 +0000
@@ -32,8 +32,8 @@
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.scheduling.ProcessLogger;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * Default implementation to clean up an entity.
@@ -50,7 +50,7 @@
 public class CleanEntity {
   protected static final String SYSTEM = "0";
 
-  private static final Logger log = LoggerFactory.getLogger(CleanEntity.class);
+  private static final Logger log = LogManager.getLogger();
 
   /**
    * Clean logs for an entity
--- a/modules/org.openbravo.utility.cleanup.log/src/org/openbravo/utility/cleanup/log/LogCleanUpProcess.java	Tue Dec 11 12:11:50 2018 +0000
+++ b/modules/org.openbravo.utility.cleanup.log/src/org/openbravo/utility/cleanup/log/LogCleanUpProcess.java	Tue Dec 11 12:26:44 2018 +0000
@@ -43,8 +43,8 @@
 import org.openbravo.scheduling.ProcessBundle;
 import org.openbravo.scheduling.ProcessLogger;
 import org.openbravo.service.db.DalBaseProcess;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 /**
  * This is the process that is invoked to perform the clean up of configured entities.
@@ -53,7 +53,7 @@
  * 
  */
 public class LogCleanUpProcess extends DalBaseProcess {
-  private static final Logger log = LoggerFactory.getLogger(LogCleanUpConfig.class);
+  private static final Logger log = LogManager.getLogger();
 
   @Override
   protected void doExecute(ProcessBundle bundle) throws Exception {
--- a/referencedata/sampledata/QA_Testing/AD_PINSTANCE.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/referencedata/sampledata/QA_Testing/AD_PINSTANCE.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -68,6 +68,22 @@
 </AD_PINSTANCE>
 
 <AD_PINSTANCE>
+  <AD_PINSTANCE_ID><![CDATA[0B6C4D7C648941078351B79C5A002E4D]]></AD_PINSTANCE_ID>
+  <AD_PROCESS_ID><![CDATA[104]]></AD_PROCESS_ID>
+  <RECORD_ID><![CDATA[C4CD2F1E708B44CB8796521C73D925CB]]></RECORD_ID>
+  <ISPROCESSING><![CDATA[N]]></ISPROCESSING>
+  <CREATED><![CDATA[2018-10-15 21:39:48.0]]></CREATED>
+  <AD_USER_ID><![CDATA[100]]></AD_USER_ID>
+  <UPDATED><![CDATA[2018-10-15 21:39:48.0]]></UPDATED>
+  <RESULT><![CDATA[1]]></RESULT>
+  <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
+  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+  <CREATEDBY><![CDATA[100]]></CREATEDBY>
+  <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+</AD_PINSTANCE>
+
+<AD_PINSTANCE>
   <AD_PINSTANCE_ID><![CDATA[0F5B0E132E3044ED8DA5C133E7951671]]></AD_PINSTANCE_ID>
   <AD_PROCESS_ID><![CDATA[167]]></AD_PROCESS_ID>
   <RECORD_ID><![CDATA[5B0862FE46E34063A62C82FCC7BCF2A8]]></RECORD_ID>
@@ -558,6 +574,22 @@
 </AD_PINSTANCE>
 
 <AD_PINSTANCE>
+  <AD_PINSTANCE_ID><![CDATA[60A99EF08EA4499DA69287EEF0A82033]]></AD_PINSTANCE_ID>
+  <AD_PROCESS_ID><![CDATA[104]]></AD_PROCESS_ID>
+  <RECORD_ID><![CDATA[C4CD2F1E708B44CB8796521C73D925CB]]></RECORD_ID>
+  <ISPROCESSING><![CDATA[N]]></ISPROCESSING>
+  <CREATED><![CDATA[2018-10-15 21:39:42.0]]></CREATED>
+  <AD_USER_ID><![CDATA[100]]></AD_USER_ID>
+  <UPDATED><![CDATA[2018-10-15 21:39:43.0]]></UPDATED>
+  <RESULT><![CDATA[1]]></RESULT>
+  <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
+  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+  <CREATEDBY><![CDATA[100]]></CREATEDBY>
+  <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+</AD_PINSTANCE>
+
+<AD_PINSTANCE>
   <AD_PINSTANCE_ID><![CDATA[60BE8271BC4640C9B8179FDE43226119]]></AD_PINSTANCE_ID>
   <AD_PROCESS_ID><![CDATA[100]]></AD_PROCESS_ID>
   <RECORD_ID><![CDATA[7D25AAA6427F496D9DA7C6539AD73477]]></RECORD_ID>
--- a/referencedata/sampledata/QA_Testing/AD_PROCESS_REQUEST.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/referencedata/sampledata/QA_Testing/AD_PROCESS_REQUEST.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -55,6 +55,24 @@
 </AD_PROCESS_REQUEST>
 
 <AD_PROCESS_REQUEST>
+  <AD_PROCESS_REQUEST_ID><![CDATA[2D4FE13F82EC47BA8D82D0903C39A553]]></AD_PROCESS_REQUEST_ID>
+  <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
+  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+  <CREATED><![CDATA[2018-10-15 21:39:48.0]]></CREATED>
+  <CREATEDBY><![CDATA[100]]></CREATEDBY>
+  <UPDATED><![CDATA[2018-10-15 21:39:48.0]]></UPDATED>
+  <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+  <AD_PROCESS_ID><![CDATA[104]]></AD_PROCESS_ID>
+  <AD_USER_ID><![CDATA[100]]></AD_USER_ID>
+  <ISROLESECURITY><![CDATA[Y]]></ISROLESECURITY>
+  <OB_CONTEXT><![CDATA[{"org.openbravo.scheduling.ProcessContext":{"user":100,"role":"4028E6C72959682B01295A071429011E","language":"en_US","theme":"ltr\/org.openbravo.userinterface.skin.250to300Comp\/250to300Comp","client":"4028E6C72959682B01295A070852010D","organization":0,"warehouse":"4D7B97565A024DB7B4C61650FA2B9560","command":"SAVE_BUTTONDocAction104","userClient":"'4028E6C72959682B01295A070852010D'","userOrganization":"'5EFF95EB540740A3B10510D9814EFAD5','0','43D590B4814049C6B85C6545E8264E37','357947E87C284935AD1D783CF6F099A1'","dbSessionID":"B107487A44B94D2EAD4B82CD782B553F","javaDateFormat":"dd-MM-yyyy","javaDateTimeFormat":"dd-MM-yyyy HH:mm:ss","jsDateFormat":"%d-%m-%Y","sqlDateFormat":"DD-MM-YYYY","accessLevel":1,"roleSecurity":true}}]]></OB_CONTEXT>
+  <STATUS><![CDATA[COM]]></STATUS>
+  <CHANNEL><![CDATA[Direct]]></CHANNEL>
+  <ISGROUP><![CDATA[N]]></ISGROUP>
+</AD_PROCESS_REQUEST>
+
+<AD_PROCESS_REQUEST>
   <AD_PROCESS_REQUEST_ID><![CDATA[30A62F89023A4876A588D84470BE4C8A]]></AD_PROCESS_REQUEST_ID>
   <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
   <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
@@ -91,6 +109,24 @@
 </AD_PROCESS_REQUEST>
 
 <AD_PROCESS_REQUEST>
+  <AD_PROCESS_REQUEST_ID><![CDATA[39DF671018D74D1BAD0E19EFF771991F]]></AD_PROCESS_REQUEST_ID>
+  <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
+  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+  <CREATED><![CDATA[2018-10-15 21:39:42.0]]></CREATED>
+  <CREATEDBY><![CDATA[100]]></CREATEDBY>
+  <UPDATED><![CDATA[2018-10-15 21:39:43.0]]></UPDATED>
+  <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+  <AD_PROCESS_ID><![CDATA[104]]></AD_PROCESS_ID>
+  <AD_USER_ID><![CDATA[100]]></AD_USER_ID>
+  <ISROLESECURITY><![CDATA[Y]]></ISROLESECURITY>
+  <OB_CONTEXT><![CDATA[{"org.openbravo.scheduling.ProcessContext":{"user":100,"role":"4028E6C72959682B01295A071429011E","language":"en_US","theme":"ltr\/org.openbravo.userinterface.skin.250to300Comp\/250to300Comp","client":"4028E6C72959682B01295A070852010D","organization":0,"warehouse":"4D7B97565A024DB7B4C61650FA2B9560","command":"SAVE_BUTTONDocAction104","userClient":"'4028E6C72959682B01295A070852010D'","userOrganization":"'5EFF95EB540740A3B10510D9814EFAD5','0','43D590B4814049C6B85C6545E8264E37','357947E87C284935AD1D783CF6F099A1'","dbSessionID":"B107487A44B94D2EAD4B82CD782B553F","javaDateFormat":"dd-MM-yyyy","javaDateTimeFormat":"dd-MM-yyyy HH:mm:ss","jsDateFormat":"%d-%m-%Y","sqlDateFormat":"DD-MM-YYYY","accessLevel":1,"roleSecurity":true}}]]></OB_CONTEXT>
+  <STATUS><![CDATA[COM]]></STATUS>
+  <CHANNEL><![CDATA[Direct]]></CHANNEL>
+  <ISGROUP><![CDATA[N]]></ISGROUP>
+</AD_PROCESS_REQUEST>
+
+<AD_PROCESS_REQUEST>
   <AD_PROCESS_REQUEST_ID><![CDATA[502EF7AF73264B9B8F76A1AAA4BE8887]]></AD_PROCESS_REQUEST_ID>
   <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
   <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
--- a/referencedata/sampledata/QA_Testing/AD_SEQUENCE.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/referencedata/sampledata/QA_Testing/AD_SEQUENCE.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -1991,7 +1991,7 @@
   <ISAUTOSEQUENCE><![CDATA[Y]]></ISAUTOSEQUENCE>
   <INCREMENTNO><![CDATA[1]]></INCREMENTNO>
   <STARTNO><![CDATA[1000000]]></STARTNO>
-  <CURRENTNEXT><![CDATA[2]]></CURRENTNEXT>
+  <CURRENTNEXT><![CDATA[3]]></CURRENTNEXT>
   <CURRENTNEXTSYS><![CDATA[100]]></CURRENTNEXTSYS>
   <ISTABLEID><![CDATA[N]]></ISTABLEID>
   <PREFIX><![CDATA[RFC/]]></PREFIX>
--- a/referencedata/sampledata/QA_Testing/C_ORDER.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/referencedata/sampledata/QA_Testing/C_ORDER.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -1360,6 +1360,71 @@
 </C_ORDER>
 
 <C_ORDER>
+  <C_ORDER_ID><![CDATA[C4CD2F1E708B44CB8796521C73D925CB]]></C_ORDER_ID>
+  <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
+  <AD_ORG_ID><![CDATA[357947E87C284935AD1D783CF6F099A1]]></AD_ORG_ID>
+  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+  <CREATED><![CDATA[2018-10-15 21:39:04.0]]></CREATED>
+  <CREATEDBY><![CDATA[100]]></CREATEDBY>
+  <UPDATED><![CDATA[2018-10-15 21:39:48.0]]></UPDATED>
+  <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+  <ISSOTRX><![CDATA[Y]]></ISSOTRX>
+  <DOCUMENTNO><![CDATA[RFC/2]]></DOCUMENTNO>
+  <DOCSTATUS><![CDATA[DR]]></DOCSTATUS>
+  <DOCACTION><![CDATA[CO]]></DOCACTION>
+  <PROCESSING><![CDATA[N]]></PROCESSING>
+  <PROCESSED><![CDATA[N]]></PROCESSED>
+  <C_DOCTYPE_ID><![CDATA[C789FE062AA8480BAD91543A0C6B41AB]]></C_DOCTYPE_ID>
+  <C_DOCTYPETARGET_ID><![CDATA[C789FE062AA8480BAD91543A0C6B41AB]]></C_DOCTYPETARGET_ID>
+  <ISDELIVERED><![CDATA[N]]></ISDELIVERED>
+  <ISINVOICED><![CDATA[N]]></ISINVOICED>
+  <ISPRINTED><![CDATA[N]]></ISPRINTED>
+  <ISSELECTED><![CDATA[N]]></ISSELECTED>
+  <DATEORDERED><![CDATA[2018-10-15 00:00:00.0]]></DATEORDERED>
+  <DATEPROMISED><![CDATA[2018-10-15 00:00:00.0]]></DATEPROMISED>
+  <DATEACCT><![CDATA[2018-10-15 00:00:00.0]]></DATEACCT>
+  <C_BPARTNER_ID><![CDATA[4028E6C72959682B01295F40C3CB02EC]]></C_BPARTNER_ID>
+  <BILLTO_ID><![CDATA[4028E6C72959682B01295F40C43802EE]]></BILLTO_ID>
+  <C_BPARTNER_LOCATION_ID><![CDATA[4028E6C72959682B01295F40C43802EE]]></C_BPARTNER_LOCATION_ID>
+  <ISDISCOUNTPRINTED><![CDATA[N]]></ISDISCOUNTPRINTED>
+  <C_CURRENCY_ID><![CDATA[102]]></C_CURRENCY_ID>
+  <PAYMENTRULE><![CDATA[4]]></PAYMENTRULE>
+  <C_PAYMENTTERM_ID><![CDATA[7B308C5CB9674BB3A56E63D85887058A]]></C_PAYMENTTERM_ID>
+  <INVOICERULE><![CDATA[S]]></INVOICERULE>
+  <DELIVERYRULE><![CDATA[A]]></DELIVERYRULE>
+  <FREIGHTCOSTRULE><![CDATA[I]]></FREIGHTCOSTRULE>
+  <FREIGHTAMT><![CDATA[0]]></FREIGHTAMT>
+  <DELIVERYVIARULE><![CDATA[P]]></DELIVERYVIARULE>
+  <CHARGEAMT><![CDATA[0]]></CHARGEAMT>
+  <PRIORITYRULE><![CDATA[5]]></PRIORITYRULE>
+  <TOTALLINES><![CDATA[-35]]></TOTALLINES>
+  <GRANDTOTAL><![CDATA[-38.5]]></GRANDTOTAL>
+  <M_WAREHOUSE_ID><![CDATA[4D7B97565A024DB7B4C61650FA2B9560]]></M_WAREHOUSE_ID>
+  <M_PRICELIST_ID><![CDATA[4028E6C72959682B01295B03CE480243]]></M_PRICELIST_ID>
+  <ISTAXINCLUDED><![CDATA[N]]></ISTAXINCLUDED>
+  <POSTED><![CDATA[N]]></POSTED>
+  <AD_USER_ID><![CDATA[4028E6C72959682B01295F40C43802EF]]></AD_USER_ID>
+  <COPYFROM><![CDATA[N]]></COPYFROM>
+  <ISSELFSERVICE><![CDATA[N]]></ISSELFSERVICE>
+  <GENERATETEMPLATE><![CDATA[N]]></GENERATETEMPLATE>
+  <COPYFROMPO><![CDATA[N]]></COPYFROMPO>
+  <FIN_PAYMENTMETHOD_ID><![CDATA[42E87E97974E4B35849A430B8F6F2884]]></FIN_PAYMENTMETHOD_ID>
+  <RM_PICKFROMSHIPMENT><![CDATA[N]]></RM_PICKFROMSHIPMENT>
+  <RM_RECEIVEMATERIALS><![CDATA[N]]></RM_RECEIVEMATERIALS>
+  <RM_CREATEINVOICE><![CDATA[N]]></RM_CREATEINVOICE>
+  <RM_ADDORPHANLINE><![CDATA[N]]></RM_ADDORPHANLINE>
+  <CALCULATE_PROMOTIONS><![CDATA[N]]></CALCULATE_PROMOTIONS>
+  <CONVERTQUOTATION><![CDATA[N]]></CONVERTQUOTATION>
+  <CREATE_POLINES><![CDATA[N]]></CREATE_POLINES>
+  <ISCASHVAT><![CDATA[N]]></ISCASHVAT>
+  <RM_PICKFROMRECEIPT><![CDATA[N]]></RM_PICKFROMRECEIPT>
+  <CANCELANDREPLACE><![CDATA[N]]></CANCELANDREPLACE>
+  <CONFIRMCANCELANDREPLACE><![CDATA[N]]></CONFIRMCANCELANDREPLACE>
+  <ISCANCELLED><![CDATA[N]]></ISCANCELLED>
+  <EM_APRM_ADDPAYMENT><![CDATA[N]]></EM_APRM_ADDPAYMENT>
+</C_ORDER>
+
+<C_ORDER>
   <C_ORDER_ID><![CDATA[C7B155F988D94156911D6622816FCACD]]></C_ORDER_ID>
   <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
   <AD_ORG_ID><![CDATA[357947E87C284935AD1D783CF6F099A1]]></AD_ORG_ID>
--- a/referencedata/sampledata/QA_Testing/C_ORDERLINE.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/referencedata/sampledata/QA_Testing/C_ORDERLINE.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -1902,6 +1902,54 @@
 </C_ORDERLINE>
 
 <C_ORDERLINE>
+  <C_ORDERLINE_ID><![CDATA[71CEDD4203FF4DC58000752BA9A0F8E7]]></C_ORDERLINE_ID>
+  <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
+  <AD_ORG_ID><![CDATA[357947E87C284935AD1D783CF6F099A1]]></AD_ORG_ID>
+  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+  <CREATED><![CDATA[2018-10-15 21:39:33.0]]></CREATED>
+  <CREATEDBY><![CDATA[100]]></CREATEDBY>
+  <UPDATED><![CDATA[2018-10-15 21:39:48.0]]></UPDATED>
+  <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+  <C_ORDER_ID><![CDATA[C4CD2F1E708B44CB8796521C73D925CB]]></C_ORDER_ID>
+  <LINE><![CDATA[10]]></LINE>
+  <DATEORDERED><![CDATA[2018-10-15 00:00:00.0]]></DATEORDERED>
+  <M_PRODUCT_ID><![CDATA[EBCD272DC37B4ABBB12B96139E5837BF]]></M_PRODUCT_ID>
+  <M_WAREHOUSE_ID><![CDATA[4D7B97565A024DB7B4C61650FA2B9560]]></M_WAREHOUSE_ID>
+  <DIRECTSHIP><![CDATA[N]]></DIRECTSHIP>
+  <C_UOM_ID><![CDATA[100]]></C_UOM_ID>
+  <QTYORDERED><![CDATA[-1]]></QTYORDERED>
+  <QTYRESERVED><![CDATA[0]]></QTYRESERVED>
+  <QTYDELIVERED><![CDATA[0]]></QTYDELIVERED>
+  <QTYINVOICED><![CDATA[0]]></QTYINVOICED>
+  <C_CURRENCY_ID><![CDATA[102]]></C_CURRENCY_ID>
+  <PRICELIST><![CDATA[35]]></PRICELIST>
+  <PRICEACTUAL><![CDATA[35]]></PRICEACTUAL>
+  <PRICELIMIT><![CDATA[0]]></PRICELIMIT>
+  <LINENETAMT><![CDATA[-35]]></LINENETAMT>
+  <DISCOUNT><![CDATA[0]]></DISCOUNT>
+  <FREIGHTAMT><![CDATA[0]]></FREIGHTAMT>
+  <CHARGEAMT><![CDATA[0]]></CHARGEAMT>
+  <C_TAX_ID><![CDATA[F9D9AF81F4FA459C9CE7A2D9697DF1E4]]></C_TAX_ID>
+  <M_ATTRIBUTESETINSTANCE_ID><![CDATA[BC4F469EE90445AA8D6F41DE8523FA63]]></M_ATTRIBUTESETINSTANCE_ID>
+  <ISDESCRIPTION><![CDATA[N]]></ISDESCRIPTION>
+  <PRICESTD><![CDATA[35]]></PRICESTD>
+  <CANCELPRICEAD><![CDATA[N]]></CANCELPRICEAD>
+  <ISEDITLINENETAMT><![CDATA[N]]></ISEDITLINENETAMT>
+  <M_INOUTLINE_ID><![CDATA[4AE8806312034CB4919848F849CEB9A2]]></M_INOUTLINE_ID>
+  <GROSS_UNIT_PRICE><![CDATA[0]]></GROSS_UNIT_PRICE>
+  <LINE_GROSS_AMOUNT><![CDATA[0]]></LINE_GROSS_AMOUNT>
+  <GROSSPRICELIST><![CDATA[0]]></GROSSPRICELIST>
+  <GROSSPRICESTD><![CDATA[0]]></GROSSPRICESTD>
+  <MANAGE_RESERVATION><![CDATA[N]]></MANAGE_RESERVATION>
+  <MANAGE_PRERESERVATION><![CDATA[N]]></MANAGE_PRERESERVATION>
+  <EXPLODE><![CDATA[N]]></EXPLODE>
+  <PRINT_DESCRIPTION><![CDATA[N]]></PRINT_DESCRIPTION>
+  <RELATE_ORDERLINE><![CDATA[N]]></RELATE_ORDERLINE>
+  <AUMQTY><![CDATA[0]]></AUMQTY>
+  <RETURNLINE><![CDATA[Y]]></RETURNLINE>
+</C_ORDERLINE>
+
+<C_ORDERLINE>
   <C_ORDERLINE_ID><![CDATA[786F7031239A485B94D806A9830BF700]]></C_ORDERLINE_ID>
   <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
   <AD_ORG_ID><![CDATA[357947E87C284935AD1D783CF6F099A1]]></AD_ORG_ID>
--- a/referencedata/sampledata/QA_Testing/C_ORDERLINETAX.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/referencedata/sampledata/QA_Testing/C_ORDERLINETAX.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -749,6 +749,23 @@
 </C_ORDERLINETAX>
 
 <C_ORDERLINETAX>
+  <C_ORDERLINETAX_ID><![CDATA[784A9571F12B7009E0530100007F00AC]]></C_ORDERLINETAX_ID>
+  <C_ORDERLINE_ID><![CDATA[71CEDD4203FF4DC58000752BA9A0F8E7]]></C_ORDERLINE_ID>
+  <C_TAX_ID><![CDATA[F9D9AF81F4FA459C9CE7A2D9697DF1E4]]></C_TAX_ID>
+  <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
+  <AD_ORG_ID><![CDATA[357947E87C284935AD1D783CF6F099A1]]></AD_ORG_ID>
+  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+  <CREATED><![CDATA[2018-10-15 21:39:33.0]]></CREATED>
+  <CREATEDBY><![CDATA[100]]></CREATEDBY>
+  <UPDATED><![CDATA[2018-10-15 21:39:33.0]]></UPDATED>
+  <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+  <TAXBASEAMT><![CDATA[-35]]></TAXBASEAMT>
+  <TAXAMT><![CDATA[-3.5]]></TAXAMT>
+  <LINE><![CDATA[10]]></LINE>
+  <C_ORDER_ID><![CDATA[C4CD2F1E708B44CB8796521C73D925CB]]></C_ORDER_ID>
+</C_ORDERLINETAX>
+
+<C_ORDERLINETAX>
   <C_ORDERLINETAX_ID><![CDATA[799D71E867014FCDAE27B514CA9C7B1E]]></C_ORDERLINETAX_ID>
   <C_ORDERLINE_ID><![CDATA[2828250559314E42AD6EE007F4CD1E1A]]></C_ORDERLINE_ID>
   <C_TAX_ID><![CDATA[F9D9AF81F4FA459C9CE7A2D9697DF1E4]]></C_TAX_ID>
--- a/referencedata/sampledata/QA_Testing/C_ORDERTAX.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/referencedata/sampledata/QA_Testing/C_ORDERTAX.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -449,6 +449,22 @@
 </C_ORDERTAX>
 
 <C_ORDERTAX>
+  <C_ORDERTAX_ID><![CDATA[784A9571F12C7009E0530100007F00AC]]></C_ORDERTAX_ID>
+  <C_ORDER_ID><![CDATA[C4CD2F1E708B44CB8796521C73D925CB]]></C_ORDER_ID>
+  <C_TAX_ID><![CDATA[F9D9AF81F4FA459C9CE7A2D9697DF1E4]]></C_TAX_ID>
+  <AD_CLIENT_ID><![CDATA[4028E6C72959682B01295A070852010D]]></AD_CLIENT_ID>
+  <AD_ORG_ID><![CDATA[357947E87C284935AD1D783CF6F099A1]]></AD_ORG_ID>
+  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+  <CREATED><![CDATA[2018-10-15 21:39:33.0]]></CREATED>
+  <CREATEDBY><![CDATA[100]]></CREATEDBY>
+  <UPDATED><![CDATA[2018-10-15 21:39:33.0]]></UPDATED>
+  <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+  <TAXBASEAMT><![CDATA[-35]]></TAXBASEAMT>
+  <TAXAMT><![CDATA[-3.5]]></TAXAMT>
+  <LINE><![CDATA[10]]></LINE>
+</C_ORDERTAX>
+
+<C_ORDERTAX>
   <C_ORDERTAX_ID><![CDATA[7BFBB04C78EB4E79AAE803AF36BC5827]]></C_ORDERTAX_ID>
   <C_ORDER_ID><![CDATA[FF808081329052F301329089D7DE00C7]]></C_ORDER_ID>
   <C_TAX_ID><![CDATA[3271411A5AFB490A91FB618B6B789C24]]></C_TAX_ID>
--- a/referencedata/sampledata/QA_Testing/C_PERIOD.xml	Tue Dec 11 12:11:50 2018 +0000
+++ b/referencedata/sampledata/QA_Testing/C_PERIOD.xml	Tue Dec 11 12:26:44 2018 +0000
@@ -45,11 +45,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.816]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[May-10]]></NAME>
+  <NAME><![CDATA[May-19]]></NAME>
   <PERIODNO><![CDATA[5]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-05-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-05-31 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-05-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-05-31 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -117,11 +117,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.818]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Feb-10]]></NAME>
+  <NAME><![CDATA[Feb-19]]></NAME>
   <PERIODNO><![CDATA[2]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-02-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-02-28 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-02-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-02-28 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -279,11 +279,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.819]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Oct-10]]></NAME>
+  <NAME><![CDATA[Oct-19]]></NAME>
   <PERIODNO><![CDATA[10]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-10-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-10-31 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-10-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-10-31 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -333,11 +333,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.825]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Apr-10]]></NAME>
+  <NAME><![CDATA[Apr-19]]></NAME>
   <PERIODNO><![CDATA[4]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-04-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-04-30 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-04-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-04-30 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -549,11 +549,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.819]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Jan-10]]></NAME>
+  <NAME><![CDATA[Jan-19]]></NAME>
   <PERIODNO><![CDATA[1]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-01-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-01-31 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-01-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-01-31 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -711,11 +711,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.817]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Nov-10]]></NAME>
+  <NAME><![CDATA[Nov-19]]></NAME>
   <PERIODNO><![CDATA[11]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-11-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-11-30 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-11-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-11-30 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -1143,11 +1143,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.817]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Jul-10]]></NAME>
+  <NAME><![CDATA[Jul-19]]></NAME>
   <PERIODNO><![CDATA[7]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-07-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-07-31 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-07-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-07-31 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -1323,11 +1323,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.819]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Mar-10]]></NAME>
+  <NAME><![CDATA[Mar-19]]></NAME>
   <PERIODNO><![CDATA[3]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-03-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-03-31 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-03-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-03-31 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -1341,11 +1341,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.816]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Sep-10]]></NAME>
+  <NAME><![CDATA[Sep-19]]></NAME>
   <PERIODNO><![CDATA[9]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-09-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-09-30 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-09-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-09-30 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -1377,11 +1377,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.82]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Jun-10]]></NAME>
+  <NAME><![CDATA[Jun-19]]></NAME>
   <PERIODNO><![CDATA[6]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-06-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-06-30 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-06-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-06-30 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -1557,11 +1557,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.816]]></UPDATED>
   <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-  <NAME><![CDATA[Dec-10]]></NAME>
+  <NAME><![CDATA[Dec-19]]></NAME>
   <PERIODNO><![CDATA[12]]></PERIODNO>
   <C_YEAR_ID><![CDATA[9FF27DFF64FB464A8424429A4DC30B88]]></C_YEAR_ID>
-  <STARTDATE><![CDATA[2010-12-01 00:00:00.0]]></STARTDATE>
-  <ENDDATE><![CDATA[2010-12-31 00:00:00.0]]></ENDDATE>
+  <STARTDATE><![CDATA[2019-12-01 00:00:00.0]]></STARTDATE>
+  <ENDDATE><![CDATA[2019-12-31 00:00:00.0]]></ENDDATE>
   <PERIODTYPE><![CDATA[S]]></PERIODTYPE>
   <OPENCLOSE><![CDATA[C]]></OPENCLOSE>
 </C_PERIOD>
@@ -1611,11 +1611,11 @@
   <CREATEDBY><![CDATA[0]]></CREATEDBY>
   <UPDATED><![CDATA[2013-07-04 23:38:17.819]]></UPDATED>