Merge temporary head for 3.0PR16Q2
authorRM packaging bot <staff.rm@openbravo.com>
Thu, 16 Jun 2016 05:35:45 +0000
changeset 29873 73a8cd831ca4
parent 29805 bc959c5d63fd (diff)
parent 29872 26b4c9f9cfdf (current diff)
child 29874 4a8a100af104
Merge temporary head for 3.0PR16Q2
.hgsigs
.hgtags
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
src-db/database/model/functions/C_GET_SERVICE_AMOUNT.xml
src-db/database/model/functions/C_ORDER_POST1.xml
src-db/database/model/triggers/C_ORDERLINE_TRG.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MODULE.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/OBUIAPP_PROCESS.xml
src-test/src/org/openbravo/test/services/ServicesTest.java
src/org/openbravo/base/secureApp/LoginUtils.java
src/org/openbravo/common/actionhandler/ServiceOrderLineRelate.java
src/org/openbravo/erpCommon/info/ServiceProductPricePrecisionFilterExpression.java
src/org/openbravo/erpCommon/utility/OBLedgerUtils.java
src/org/openbravo/event/ServiceOrderLineEventHandler.java
src/org/openbravo/materialmgmt/ServicePriceUtils.java
--- a/.hgsigs	Fri Jun 10 09:50:42 2016 +0000
+++ b/.hgsigs	Thu Jun 16 05:35:45 2016 +0000
@@ -189,5 +189,9 @@
 24d2967df096de06913c9991553c1d84b07df9b6 0 iEYEABECAAYFAla9YYIACgkQCX/oGf+2qkNH7wCfV32iOyR/TQKzW/mH1iHTir6f6h4AoIlh4QBWIShpJqbJvx2IhfARpvUZ
 f016ea545c924ad099e9e402689035f1dd73baa2 0 iEYEABECAAYFAlbTzQoACgkQCX/oGf+2qkP28wCdFpNqpw+ODgF0p3cMJAbTZy1IPfoAoNEuRHkZIM5bNJMjwU0/GhjCtwah
 a53670f00eb6c9225829a660075fcfffa1109a1e 0 iEYEABECAAYFAlbqRpEACgkQCX/oGf+2qkN5qQCgsO1APX5AJ4cpb0oJX5vUQnvPMusAoPoDaQxGDihvsB4BSGW60RIxBdGC
+bdeb5a373f19eb7a144377621926d877ae2322f1 0 iEYEABECAAYFAlcgSPgACgkQCX/oGf+2qkMPLwCgzV//EHUa2bHmP8FA2IwnrFWB1X4AnjGHHjYKfSwiucQhltXR9POZXGaX
 38ef1dc10aa3d6fb8210b85beab370f62a4545ca 0 iEYEABECAAYFAlbiTM0ACgkQCX/oGf+2qkNBDwCfXmKXkqNGsAsfiofYOBBdvjA/XgkAoIwLK3DkmHeM71JihwfVOWyB4hmj
+265e8eccf704614fe88220026f2e2bafcebaaf00 0 iEYEABECAAYFAlcgZEQACgkQCX/oGf+2qkPuZgCcDPuB9d77M+51AglMvvmtpCDtnvoAnjqst7QgD6IP3Sv21+4vlqEjLVqU
+98bdf9167a3d4ea9cb9b6f5e214a539220a3f3cb 0 iEYEABECAAYFAldD+MEACgkQCX/oGf+2qkPLHwCgngPaeyLsiGk2FhShX4/IzVARWN8AnRSCXIoWp6ruOcbEfIUFQiM9lY7f
+008d208ba1f60804fd852570f0cd7e985a4220da 0 iEYEABECAAYFAldQUXwACgkQCX/oGf+2qkOtLQCdEZMKf7VfsSt6iVUl59GzwNdr7C4AoK4B3pbbW23fqYd1qplclO3aGm1B
 91b0a6cc5947ea0958b3d677a3e76174fa0a045e 0 iEYEABECAAYFAldajXIACgkQCX/oGf+2qkMRiQCgread+PDPwOVh7Qu/IlmeCLDSPVQAn3cepToICm61fiNkrV+PmFen4bwd
--- a/.hgtags	Fri Jun 10 09:50:42 2016 +0000
+++ b/.hgtags	Thu Jun 16 05:35:45 2016 +0000
@@ -200,5 +200,9 @@
 9985680adffaf70ffcc1f560860feb10f0ee6b33 3.0PR15Q4.3
 70df4e4c5cab6d37f10eceee6b66be039c381556 3.0PR15Q4.4
 21c8ed48293c94cbe5875a8edef08aca0efd2bf4 3.0PR15Q4.5
+8828e6e8e071247f329320c63da66e30c357da9f 3.0PR15Q4.6
 ee5383e071318afe8eece515b4b264cfb46c1a84 3.0PR16Q1
+d386f41fa755d23e0e23f881aece691009051ebd 3.0PR16Q1.1
+ec73935a2c83b6164a18cb70996226cb15672038 3.0PR16Q1.2
+208b773131650c3806cefa65b4d5df9bf1992821 3.0PR16Q1.3
 cfff3c184b53528cd71acfe21b15800db17b3436 3.0PR16Q2
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></NAME>
-<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.28860]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.28838]]></VERSION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <DESCRIPTION><![CDATA[Managing your finances with an ERP does not have to be difficult. Enjoy a radically improved user experience that combines the power of an enterprise grade financial application with the simplicity and ease of a web 2.0 personal accounting service.]]></DESCRIPTION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <HELP><![CDATA[Advanced Payables and Receivables Management simplifies and automates the business processes around the management of financial accounts, from the receipt and issue of payment, to the reconciliation of those events with bank statements.
 If you would like to help shape this module you are welcome to take part in the forum discussions or register feature requests or issues in the corresponding (Forum and Bug Tracking) sections in the Advanced Payables and Receivable project in the OB Forge.]]></HELP>
@@ -25,7 +25,7 @@
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <UPDATEINFO><![CDATA[Fixed issue with document sequence numbers reset in case of applying dataset second time.
 Fixed issue 15305.]]></UPDATEINFO>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <REFERENCEDATAINFO><![CDATA[Document types and default algorithm for bank statement auto matching]]></REFERENCEDATAINFO>
-<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--A918E3331C404B889D69AA9BFAFB23AC--></AD_MODULE>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID>
-<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Selector]]></DEPENDANT_MODULE_NAME>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--B97FC854C6DD41E692161585645A900F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--B97FC854C6DD41E692161585645A900F-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--B97FC854C6DD41E692161585645A900F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--B97FC854C6DD41E692161585645A900F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--B97FC854C6DD41E692161585645A900F-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--B97FC854C6DD41E692161585645A900F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java	Thu Jun 16 05:35:45 2016 +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) 2014-2016 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,7 +21,6 @@
 import java.math.BigDecimal;
 import java.sql.SQLException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -50,7 +49,6 @@
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
-import org.openbravo.dal.service.OBQuery;
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.erpCommon.utility.OBDateUtils;
 import org.openbravo.erpCommon.utility.OBError;
@@ -293,16 +291,11 @@
       strPaymentDocumentNo = FIN_Utility.getDocumentNo(documentType, "FIN_Payment");
     }
 
-    OBContext.setAdminMode(false);
-    try {
-      FIN_Payment payment = (new AdvPaymentMngtDao()).getNewPayment(isReceipt, org, documentType,
-          strPaymentDocumentNo, bPartner, paymentMethod, finAccount, strPaymentAmount, paymentDate,
-          strReferenceNo, currency, conversionRate, convertedAmt);
-      OBDal.getInstance().getConnection(true).commit();
-      return payment;
-    } finally {
-      OBContext.restorePreviousMode();
-    }
+    FIN_Payment payment = (new AdvPaymentMngtDao()).getNewPayment(isReceipt, org, documentType,
+        strPaymentDocumentNo, bPartner, paymentMethod, finAccount, strPaymentAmount, paymentDate,
+        strReferenceNo, currency, conversionRate, convertedAmt);
+    OBDal.getInstance().getConnection(true).commit();
+    return payment;
   }
 
   private void addSelectedPSDs(FIN_Payment payment, JSONObject jsonparams, List<String> pdToRemove)
@@ -317,7 +310,7 @@
 
       boolean isWriteOff = psdRow.getBoolean("writeoff");
       // psdIds can be grouped
-      List<String> psdIds = Arrays.asList(strPSDIds.replaceAll(" ", "").split(","));
+      String[] psdIds = strPSDIds.replaceAll(" ", "").split(",");
       List<FIN_PaymentScheduleDetail> psds = getOrderedPaymentScheduleDetails(psdIds);
       BigDecimal outstandingAmount = BigDecimal.ZERO;
       BigDecimal remainingAmount = paidAmount;
@@ -339,7 +332,8 @@
         }
         // Manage negative amounts
         if ((remainingAmount.signum() > 0 && remainingAmount.compareTo(outstandingAmount) >= 0)
-            || (remainingAmount.signum() < 0 && remainingAmount.compareTo(outstandingAmount) <= 0)) {
+            || ((remainingAmount.signum() < 0 && outstandingAmount.signum() < 0) && (remainingAmount
+                .compareTo(outstandingAmount) >= 0))) {
           assignAmount = outstandingAmount;
           remainingAmount = remainingAmount.subtract(outstandingAmount);
         } else {
@@ -622,15 +616,12 @@
     return message;
   }
 
-  private List<FIN_PaymentScheduleDetail> getOrderedPaymentScheduleDetails(List<String> psdSet) {
-    StringBuffer where = new StringBuffer();
-    where.append(" as psd");
-    where.append(" where psd." + FIN_PaymentScheduleDetail.PROPERTY_ID + " in (:psdSet)");
-    where.append(" order by psd." + FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS);
-    where.append(", abs(psd." + FIN_PaymentScheduleDetail.PROPERTY_AMOUNT + ")");
-    OBQuery<FIN_PaymentScheduleDetail> orderedPSDs = OBDal.getInstance().createQuery(
-        FIN_PaymentScheduleDetail.class, where.toString());
-    orderedPSDs.setNamedParameter("psdSet", psdSet);
+  private List<FIN_PaymentScheduleDetail> getOrderedPaymentScheduleDetails(String[] psdSet) {
+    OBCriteria<FIN_PaymentScheduleDetail> orderedPSDs = OBDal.getInstance().createCriteria(
+        FIN_PaymentScheduleDetail.class);
+    orderedPSDs.add(Restrictions.in(FIN_PaymentScheduleDetail.PROPERTY_ID, psdSet));
+    orderedPSDs.addOrderBy(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS, true);
+    orderedPSDs.addOrderBy(FIN_PaymentScheduleDetail.PROPERTY_AMOUNT, true);
     return orderedPSDs.list();
   }
 
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Thu Jun 16 05:35:45 2016 +0000
@@ -578,6 +578,11 @@
       paymentScheduleDetails.add(paymentScheduleDetail);
       newPaymentDetail.setFINPaymentScheduleDetailList(paymentScheduleDetails);
 
+      if (payment.getDocumentType().getDocumentSequence() != null) {
+        OBContext.getOBContext().addWritableOrganization(
+            payment.getDocumentType().getDocumentSequence().getOrganization().getId());
+      }
+
       OBDal.getInstance().save(payment);
       OBDal.getInstance().save(newPaymentDetail);
       OBDal.getInstance().save(paymentScheduleDetail);
@@ -585,6 +590,11 @@
         OBDal.getInstance().flush();
       }
 
+      if (payment.getDocumentType().getDocumentSequence() != null) {
+        OBContext.getOBContext().removeWritableOrganization(
+            payment.getDocumentType().getDocumentSequence().getOrganization().getId());
+      }
+
       return newPaymentDetail;
     } finally {
       OBContext.restorePreviousMode();
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java	Thu Jun 16 05:35:45 2016 +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-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -25,7 +25,6 @@
 import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
-import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.dao.TransactionsDao;
 import org.openbravo.advpaymentmngt.exception.NoExecutionProcessFoundException;
@@ -35,7 +34,6 @@
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
-import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.erpCommon.utility.OBError;
@@ -196,17 +194,8 @@
                     if (FIN_Utility.isAutomaticDepositWithdrawn(paymentRunPayment.getPayment())
                         && paymentRunPayment.getPayment().getAmount().compareTo(BigDecimal.ZERO) != 0
                         && !StringUtils.equals(internalParameters.get("comingFrom"), "TRANSACTION")) {
-                      OBCriteria<FIN_FinaccTransaction> finAccTransactionCriteria = OBDal
-                          .getInstance().createCriteria(FIN_FinaccTransaction.class);
-                      finAccTransactionCriteria.add(Restrictions.eq(
-                          FIN_FinaccTransaction.PROPERTY_FINPAYMENT, payment));
-                      finAccTransactionCriteria.setMaxResults(1);
-                      FIN_FinaccTransaction transaction = (FIN_FinaccTransaction) finAccTransactionCriteria
-                          .uniqueResult();
-                      if (transaction == null) {
-                        transaction = TransactionsDao.createFinAccTransaction(paymentRunPayment
-                            .getPayment());
-                      }
+                      FIN_FinaccTransaction transaction = TransactionsDao
+                          .createFinAccTransaction(paymentRunPayment.getPayment());
                       VariablesSecureApp vars = new VariablesSecureApp(RequestContext.get()
                           .getRequest());
                       OBError processTransactionError = processTransaction(vars,
--- a/modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--8A098711BB324335A19833286BDB093D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8A098711BB324335A19833286BDB093D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8A098711BB324335A19833286BDB093D-->  <NAME><![CDATA[Apache External Connection Pool]]></NAME>
-<!--8A098711BB324335A19833286BDB093D-->  <VERSION><![CDATA[1.0.28860]]></VERSION>
+<!--8A098711BB324335A19833286BDB093D-->  <VERSION><![CDATA[1.0.28838]]></VERSION>
 <!--8A098711BB324335A19833286BDB093D-->  <DESCRIPTION><![CDATA[Apache External Connection Pool]]></DESCRIPTION>
 <!--8A098711BB324335A19833286BDB093D-->  <HELP><![CDATA[This module implements the Apache JDBC Connection Pool (http://wiki.openbravo.com/wiki/Modules:Apache_JDBC_Connection_Pool).]]></HELP>
 <!--8A098711BB324335A19833286BDB093D-->  <TYPE><![CDATA[M]]></TYPE>
@@ -20,7 +20,7 @@
 <!--8A098711BB324335A19833286BDB093D-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--8A098711BB324335A19833286BDB093D-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--8A098711BB324335A19833286BDB093D-->  <UPDATEINFO><![CDATA[fixed issue #26663: configuration is read from servlet context]]></UPDATEINFO>
-<!--8A098711BB324335A19833286BDB093D-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--8A098711BB324335A19833286BDB093D-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--8A098711BB324335A19833286BDB093D-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--8A098711BB324335A19833286BDB093D-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--8A098711BB324335A19833286BDB093D--></AD_MODULE>
--- a/modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--1467C397BC5F4999A5606F39CD6FF8A4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--1467C397BC5F4999A5606F39CD6FF8A4-->  <AD_MODULE_ID><![CDATA[8A098711BB324335A19833286BDB093D]]></AD_MODULE_ID>
 <!--1467C397BC5F4999A5606F39CD6FF8A4-->  <AD_DEPENDENT_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_DEPENDENT_MODULE_ID>
-<!--1467C397BC5F4999A5606F39CD6FF8A4-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--1467C397BC5F4999A5606F39CD6FF8A4-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--1467C397BC5F4999A5606F39CD6FF8A4-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--1467C397BC5F4999A5606F39CD6FF8A4-->  <DEPENDANT_MODULE_NAME><![CDATA[Openbravo 3.0 Framework]]></DEPENDANT_MODULE_NAME>
 <!--1467C397BC5F4999A5606F39CD6FF8A4-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <NAME><![CDATA[JBoss Weld]]></NAME>
-<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.28860]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.28838]]></VERSION>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <DESCRIPTION><![CDATA[JBoss Weld]]></DESCRIPTION>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <HELP><![CDATA[Provides the JBoss Weld framework: Java Contexts and Dependency Injection for the Java EE platform (CDI). For more information see http://seamframework.org/Weld]]></HELP>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <URL><![CDATA[http://forge.openbravo.com/projects/weld]]></URL>
@@ -22,7 +22,7 @@
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <UPDATEINFO><![CDATA[Bug fixing.]]></UPDATEINFO>
-<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--C70732EA90A14EC0916078B85CC33D2D--></AD_MODULE>
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <AD_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_MODULE_ID>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <NAME><![CDATA[User Interface Application]]></NAME>
-<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION><![CDATA[2.1.28860]]></VERSION>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION><![CDATA[2.1.28838]]></VERSION>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <DESCRIPTION><![CDATA[Provides the main application components for the openbravo user interface]]></DESCRIPTION>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <HELP><![CDATA[Provides the main application components for the openbravo user interface. The main layout incorporates a navigation bar and a main view area.]]></HELP>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <URL><![CDATA[http://forge.openbravo.com/projects/clientapplication]]></URL>
@@ -22,7 +22,7 @@
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <UPDATEINFO><![CDATA[Styling bugfixing]]></UPDATEINFO>
-<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--9BA0836A3CD74EE4AB48753A47211BCC--></AD_MODULE>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--15D7CE8D95D043189162DBABA54A1F61-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--15D7CE8D95D043189162DBABA54A1F61-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--60A170212F36499D83B8AD38D01F46B3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--60A170212F36499D83B8AD38D01F46B3-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--60A170212F36499D83B8AD38D01F46B3-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--824D60CB352E4099B1D8C903CA139DAE-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--824D60CB352E4099B1D8C903CA139DAE-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--E8FD820AFE3D4FE08C02FC47769026AD-->  <STARTVERSION><![CDATA[8.1.28860]]></STARTVERSION>
+<!--E8FD820AFE3D4FE08C02FC47769026AD-->  <STARTVERSION><![CDATA[8.1.28838]]></STARTVERSION>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Thu Jun 16 05:35:45 2016 +0000
@@ -949,8 +949,6 @@
     if (request.params.MODE === 'EDIT') {
       this.view.statusBar.mode = 'VIEW';
       this.view.statusBar.setContentLabel(null, null, this.getStatusBarFields());
-    } else if (modeIsNew) {
-      this.view.statusBar.setNewState(true);
     }
 
     if (this.callSaveAfterFICReturn) {
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <NAME><![CDATA[HTML Widget]]></NAME>
-<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION><![CDATA[1.0.28860]]></VERSION>
+<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION><![CDATA[1.0.28838]]></VERSION>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <DESCRIPTION><![CDATA[Provides the HTML Widget superclass that allows to create widget classes that embed the html code.]]></DESCRIPTION>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <HELP><![CDATA[With this module you can define your own widget classes just setting up your own html code or the html code provided by third parties.]]></HELP>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <URL><![CDATA[http://forge.openbravo.com/projects/htmlwidget]]></URL>
@@ -21,7 +21,7 @@
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--D393BE6F22BB44B7B728259B34FC795A--></AD_MODULE>
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <AD_MODULE_ID><![CDATA[D393BE6F22BB44B7B728259B34FC795A]]></AD_MODULE_ID>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--DCE798FBC5B648F7A3C81A6941720A57-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--DCE798FBC5B648F7A3C81A6941720A57-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <DEPENDANT_MODULE_NAME><![CDATA[My Openbravo Tab]]></DEPENDANT_MODULE_NAME>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--4B828F4D03264080AA1D2057B13F613C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <NAME><![CDATA[User Interface Client Kernel]]></NAME>
-<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION><![CDATA[2.1.28860]]></VERSION>
+<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION><![CDATA[2.1.28838]]></VERSION>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <DESCRIPTION><![CDATA[Provides framework functionality for the Openbravo User Interface]]></DESCRIPTION>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <HELP><![CDATA[The user interface client kernel is a generation framework for generating client (browser) components used in Openbravo. Its components are mainly used by other modules to provide customizable and extendable user interfaces.]]></HELP>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <URL><![CDATA[http://forge.openbravo.com/projects/openbravoclientkernel]]></URL>
@@ -22,7 +22,7 @@
 <!--4B828F4D03264080AA1D2057B13F613C-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <UPDATEINFO><![CDATA[Bug fix for issue 15289]]></UPDATEINFO>
-<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--4B828F4D03264080AA1D2057B13F613C--></AD_MODULE>
--- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <AD_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_MODULE_ID>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--26B041893E844A53AFA58BC326C4F0D7-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--26B041893E844A53AFA58BC326C4F0D7-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <AD_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_MODULE_ID>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <STARTVERSION><![CDATA[1.1.28860]]></STARTVERSION>
+<!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <STARTVERSION><![CDATA[1.1.28838]]></STARTVERSION>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <AD_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_MODULE_ID>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <AD_DEPENDENT_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_DEPENDENT_MODULE_ID>
-<!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <STARTVERSION><![CDATA[2.0.28860]]></STARTVERSION>
+<!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <STARTVERSION><![CDATA[2.0.28838]]></STARTVERSION>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON REST Webservice]]></DEPENDANT_MODULE_NAME>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <NAME><![CDATA[Workspace & Widgets]]></NAME>
-<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION><![CDATA[2.1.28860]]></VERSION>
+<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION><![CDATA[2.1.28838]]></VERSION>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <DESCRIPTION><![CDATA[Workspace & Widgets]]></DESCRIPTION>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <HELP><![CDATA[Provides the infrastructure of workspace tab (formerly My Openbravo)]]></HELP>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <URL><![CDATA[http://forge.openbravo.com/projects/myopenbravo]]></URL>
@@ -23,7 +23,7 @@
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <UPDATEINFO><![CDATA[Styling bugfixing]]></UPDATEINFO>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <REFERENCEDATAINFO><![CDATA[Provides the infrastructure of workspace tab]]></REFERENCEDATAINFO>
-<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--2758CD25B2704AF6BBAD10365FC82C06--></AD_MODULE>
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--15F51F03882F444CAB6593B4566DC929-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--15F51F03882F444CAB6593B4566DC929-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
 <!--15F51F03882F444CAB6593B4566DC929-->  <AD_DEPENDENT_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_DEPENDENT_MODULE_ID>
-<!--15F51F03882F444CAB6593B4566DC929-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--15F51F03882F444CAB6593B4566DC929-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--15F51F03882F444CAB6593B4566DC929-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--15F51F03882F444CAB6593B4566DC929-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Application]]></DEPENDANT_MODULE_NAME>
 <!--15F51F03882F444CAB6593B4566DC929-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--E71B28FC949D481D9F59C17D01E46EF9-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--E71B28FC949D481D9F59C17D01E46EF9-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <NAME><![CDATA[Query/List Widget]]></NAME>
-<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION><![CDATA[1.0.28860]]></VERSION>
+<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION><![CDATA[1.0.28838]]></VERSION>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <DESCRIPTION><![CDATA[Provides the Query/List superclass widget that allows to create widget classes that prints a grid of data based on a query.]]></DESCRIPTION>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <HELP><![CDATA[With this module you can define your own widget classes that just with simple Application Dictionary shows a grid of data based on a HQL Query.]]></HELP>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <URL><![CDATA[http://forge.openbravo.com/projects/querylistwidget]]></URL>
@@ -21,7 +21,7 @@
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC--></AD_MODULE>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--26558497C31140BFAB067BA4BC47D799-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--26558497C31140BFAB067BA4BC47D799-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
 <!--26558497C31140BFAB067BA4BC47D799-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--26558497C31140BFAB067BA4BC47D799-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--26558497C31140BFAB067BA4BC47D799-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--26558497C31140BFAB067BA4BC47D799-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--26558497C31140BFAB067BA4BC47D799-->  <DEPENDANT_MODULE_NAME><![CDATA[My Openbravo Tab]]></DEPENDANT_MODULE_NAME>
 <!--26558497C31140BFAB067BA4BC47D799-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--FF8080812D842086012D844F3CC0003E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--FF8080812D842086012D844F3CC0003E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080812D842086012D844F3CC0003E-->  <NAME><![CDATA[Widgets Collection]]></NAME>
-<!--FF8080812D842086012D844F3CC0003E-->  <VERSION><![CDATA[0.0.28860]]></VERSION>
+<!--FF8080812D842086012D844F3CC0003E-->  <VERSION><![CDATA[0.0.28838]]></VERSION>
 <!--FF8080812D842086012D844F3CC0003E-->  <DESCRIPTION><![CDATA[Collection of Workspace Widgets]]></DESCRIPTION>
 <!--FF8080812D842086012D844F3CC0003E-->  <HELP><![CDATA[Collection of Workspace Widgets]]></HELP>
 <!--FF8080812D842086012D844F3CC0003E-->  <URL><![CDATA[http://forge.openbravo.com/projects/widgetscollection]]></URL>
@@ -22,7 +22,7 @@
 <!--FF8080812D842086012D844F3CC0003E-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--FF8080812D842086012D844F3CC0003E-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--FF8080812D842086012D844F3CC0003E-->  <UPDATEINFO><![CDATA[Added Currency Converter. Added Google Docs]]></UPDATEINFO>
-<!--FF8080812D842086012D844F3CC0003E-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--FF8080812D842086012D844F3CC0003E-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--FF8080812D842086012D844F3CC0003E-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--FF8080812D842086012D844F3CC0003E-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--FF8080812D842086012D844F3CC0003E--></AD_MODULE>
--- a/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--FF8080812D842086012D845002070046-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080812D842086012D845002070046-->  <AD_MODULE_ID><![CDATA[FF8080812D842086012D844F3CC0003E]]></AD_MODULE_ID>
 <!--FF8080812D842086012D845002070046-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080812D842086012D845002070046-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--FF8080812D842086012D845002070046-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--FF8080812D842086012D845002070046-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080812D842086012D845002070046-->  <DEPENDANT_MODULE_NAME><![CDATA[Workspace & Widgets]]></DEPENDANT_MODULE_NAME>
 <!--FF8080812D842086012D845002070046-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <NAME><![CDATA[Payment Report]]></NAME>
-<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION><![CDATA[3.0.28860]]></VERSION>
+<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION><![CDATA[3.0.28838]]></VERSION>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <DESCRIPTION><![CDATA[Payment Report]]></DESCRIPTION>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <URL><![CDATA[http://forge.openbravo.com/projects/paymentreport]]></URL>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <TYPE><![CDATA[M]]></TYPE>
@@ -22,7 +22,7 @@
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--2A5EE903D7974AC298C0504FBC4501A7--></AD_MODULE>
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_DEPENDENT_MODULE_ID>
-<!--A3B449C4D5FE4D688CC58236FE33B802-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--A3B449C4D5FE4D688CC58236FE33B802-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <DEPENDANT_MODULE_NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></DEPENDANT_MODULE_NAME>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--3A3A943684D64DEF9EC39F588A656848-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <NAME><![CDATA[Orders Awaiting Delivery]]></NAME>
-<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION><![CDATA[1.1.28860]]></VERSION>
+<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION><![CDATA[1.1.28838]]></VERSION>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <DESCRIPTION><![CDATA[Report displaying sales orders not shipped.]]></DESCRIPTION>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <URL><![CDATA[http://forge.openbravo.com/projects/ordersawaitingdlivery]]></URL>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <TYPE><![CDATA[M]]></TYPE>
@@ -19,7 +19,7 @@
 <!--3A3A943684D64DEF9EC39F588A656848-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--3A3A943684D64DEF9EC39F588A656848--></AD_MODULE>
--- a/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <AD_MODULE_ID><![CDATA[3A3A943684D64DEF9EC39F588A656848]]></AD_MODULE_ID>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <NAME><![CDATA[JSON Datasource]]></NAME>
-<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION><![CDATA[2.1.28860]]></VERSION>
+<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION><![CDATA[2.1.28838]]></VERSION>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <DESCRIPTION><![CDATA[Provides data source CRUD functionality using JSON as the data format]]></DESCRIPTION>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <HELP><![CDATA[This module implements the datasource concept. Datasources play a central role in Smartclient applications. The datasource module automatically creates a datasource for each Openbravo entity. In addition custom data source implementations can be defined.]]></HELP>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <URL><![CDATA[http://forge.openbravo.com/projects/datasourceservice]]></URL>
@@ -22,7 +22,7 @@
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <UPDATEINFO><![CDATA[Bug fixing & new development for 3.0]]></UPDATEINFO>
-<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4--></AD_MODULE>
--- a/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <STARTVERSION><![CDATA[1.1.28860]]></STARTVERSION>
+<!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <STARTVERSION><![CDATA[1.1.28838]]></STARTVERSION>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <AD_DEPENDENT_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_DEPENDENT_MODULE_ID>
-<!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <STARTVERSION><![CDATA[2.0.28860]]></STARTVERSION>
+<!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <STARTVERSION><![CDATA[2.0.28838]]></STARTVERSION>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON REST Webservice]]></DEPENDANT_MODULE_NAME>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--4FCE95802A854F7E8623AFF7C33D13EE-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--4FCE95802A854F7E8623AFF7C33D13EE-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--54AF8B39C55E4E7496902893ECD82786-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--54AF8B39C55E4E7496902893ECD82786-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--54AF8B39C55E4E7496902893ECD82786-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--D03C56D8A4E14F45A5466350E05C631F-->  <STARTVERSION><![CDATA[8.1.28860]]></STARTVERSION>
+<!--D03C56D8A4E14F45A5466350E05C631F-->  <STARTVERSION><![CDATA[8.1.28838]]></STARTVERSION>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java	Thu Jun 16 05:35:45 2016 +0000
@@ -141,7 +141,7 @@
 
       SessionInfo.setModuleId(request.getParameter("moduleId"));
       SessionInfo.setCommand(request.getParameter(DataSourceConstants.OPERATION_TYPE_PARAM));
-      SessionInfo.setProcessId(request.getParameter(JsonConstants.TAB_PARAMETER));
+      SessionInfo.setProcessId(request.getParameter("tabId"));
       SessionInfo.setProcessType("W");
 
       super.service(request, response);
@@ -202,7 +202,7 @@
       getRequestContent(request);
     }
     try {
-      if (!hasAccess(request, parameters.get(JsonConstants.TAB_PARAMETER))) {
+      if (!hasAccess(request, parameters.get("tabId"))) {
         throw new OBUserException("AccessTableNoView");
       }
 
@@ -226,9 +226,10 @@
           try {
             OBContext.setAdminMode();
             try {
-              Window window = JsonUtils.isValueEmpty(parameters.get(JsonConstants.TAB_PARAMETER)) ? null
-                  : OBDal.getInstance().get(Tab.class, parameters.get(JsonConstants.TAB_PARAMETER))
-                      .getWindow();
+              Window window = parameters.get(JsonConstants.TAB_PARAMETER) == null
+                  || parameters.get(JsonConstants.TAB_PARAMETER).equals("undefined") ? null : OBDal
+                  .getInstance().get(Tab.class, parameters.get(JsonConstants.TAB_PARAMETER))
+                  .getWindow();
               String encoding = Preferences.getPreferenceValue("OBSERDS_CSVTextEncoding", true,
                   OBContext.getOBContext().getCurrentClient(), OBContext.getOBContext()
                       .getCurrentOrganization(), OBContext.getOBContext().getUser(), OBContext
@@ -299,9 +300,9 @@
         response.setHeader("Content-Disposition", "attachment; filename=ExportedData.csv");
         writer = response.getWriter();
         VariablesSecureApp vars = new VariablesSecureApp(request);
-        Window window = JsonUtils.isValueEmpty(parameters.get(JsonConstants.TAB_PARAMETER)) ? null
-            : OBDal.getInstance().get(Tab.class, parameters.get(JsonConstants.TAB_PARAMETER))
-                .getWindow();
+        Window window = parameters.get(JsonConstants.TAB_PARAMETER) == null
+            || parameters.get(JsonConstants.TAB_PARAMETER).equals("undefined") ? null : OBDal
+            .getInstance().get(Tab.class, parameters.get(JsonConstants.TAB_PARAMETER)).getWindow();
         try {
           prefDecimalSeparator = Preferences.getPreferenceValue("OBSERDS_CSVDecimalSeparator",
               true, OBContext.getOBContext().getCurrentClient(), OBContext.getOBContext()
@@ -357,7 +358,8 @@
         }
 
         fieldProperties = new ArrayList<String>();
-        if (!JsonUtils.isValueEmpty(parameters.get("viewState"))) {
+        if (parameters.get("viewState") != null
+            && !parameters.get("viewState").toString().equals("undefined")) {
           String viewStateO = parameters.get("viewState");
           String viewStateWithoutParenthesis = viewStateO.substring(1, viewStateO.length() - 1);
           JSONObject viewState = new JSONObject(viewStateWithoutParenthesis);
@@ -687,9 +689,10 @@
       try {
         String csvMessage = null;
         try {
-          Window window = JsonUtils.isValueEmpty(parameters.get(JsonConstants.TAB_PARAMETER)) ? null
-              : OBDal.getInstance().get(Tab.class, parameters.get(JsonConstants.TAB_PARAMETER))
-                  .getWindow();
+          Window window = parameters.get(JsonConstants.TAB_PARAMETER) == null
+              || parameters.get(JsonConstants.TAB_PARAMETER).equals("undefined") ? null : OBDal
+              .getInstance().get(Tab.class, parameters.get(JsonConstants.TAB_PARAMETER))
+              .getWindow();
           csvMessage = Preferences.getPreferenceValue(property, true, OBContext.getOBContext()
               .getCurrentClient(), OBContext.getOBContext().getCurrentOrganization(), OBContext
               .getOBContext().getUser(), OBContext.getOBContext().getRole(), window);
@@ -747,7 +750,7 @@
     setSessionInfo();
 
     try {
-      if (!hasAccess(request, parameters.get(JsonConstants.TAB_PARAMETER))) {
+      if (!hasAccess(request, parameters.get("tabId"))) {
         throw new OBUserException("AccessTableNoView");
       }
 
@@ -777,7 +780,7 @@
       if (!checkSetParameters(request, response, parameters)) {
         return;
       }
-      if (!hasAccess(request, parameters.get(JsonConstants.TAB_PARAMETER))) {
+      if (!hasAccess(request, parameters.get("tabId"))) {
         throw new OBUserException("AccessTableNoView");
       }
 
@@ -815,7 +818,7 @@
     final Map<String, String> parameters = getParameterMap(request);
     setSessionInfo();
     try {
-      if (!hasAccess(request, parameters.get(JsonConstants.TAB_PARAMETER))) {
+      if (!hasAccess(request, parameters.get("tabId"))) {
         throw new OBUserException("AccessTableNoView");
       }
 
@@ -976,7 +979,7 @@
    */
   private boolean hasAccess(HttpServletRequest req, String tabId) {
     try {
-      if (JsonUtils.isValueEmpty(tabId)) {
+      if (tabId == null || tabId.isEmpty()) {
         return true;
       }
       VariablesSecureApp vars = new VariablesSecureApp(req);
--- a/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--FF8080813129ADA401312CA1222A0005-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--FF8080813129ADA401312CA1222A0005-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813129ADA401312CA1222A0005-->  <NAME><![CDATA[Integration with Google APIs]]></NAME>
-<!--FF8080813129ADA401312CA1222A0005-->  <VERSION><![CDATA[0.1.28860]]></VERSION>
+<!--FF8080813129ADA401312CA1222A0005-->  <VERSION><![CDATA[0.1.28838]]></VERSION>
 <!--FF8080813129ADA401312CA1222A0005-->  <DESCRIPTION><![CDATA[Integration with Google APIs]]></DESCRIPTION>
 <!--FF8080813129ADA401312CA1222A0005-->  <TYPE><![CDATA[M]]></TYPE>
 <!--FF8080813129ADA401312CA1222A0005-->  <LICENSE><![CDATA[Licensed under the Openbravo Public License Version 1.1.
@@ -19,7 +19,7 @@
 <!--FF8080813129ADA401312CA1222A0005-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--FF8080813129ADA401312CA1222A0005-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--FF8080813129ADA401312CA1222A0005-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--FF8080813129ADA401312CA1222A0005-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--FF8080813129ADA401312CA1222A0005-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--FF8080813129ADA401312CA1222A0005-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--FF8080813129ADA401312CA1222A0005-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--FF8080813129ADA401312CA1222A0005--></AD_MODULE>
--- a/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--FF8080813141B198013141BA0F7D0012-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813141B198013141BA0F7D0012-->  <AD_MODULE_ID><![CDATA[FF8080813129ADA401312CA1222A0005]]></AD_MODULE_ID>
 <!--FF8080813141B198013141BA0F7D0012-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080813141B198013141B86DD70003]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813141B198013141BA0F7D0012-->  <STARTVERSION><![CDATA[0.1.28860]]></STARTVERSION>
+<!--FF8080813141B198013141BA0F7D0012-->  <STARTVERSION><![CDATA[0.1.28838]]></STARTVERSION>
 <!--FF8080813141B198013141BA0F7D0012-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080813141B198013141BA0F7D0012-->  <DEPENDANT_MODULE_NAME><![CDATA[OpenID Service Integration]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813141B198013141BA0F7D0012-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--FF8080813151AEE1013151C4ACE6001B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <AD_MODULE_ID><![CDATA[FF8080813129ADA401312CA1222A0005]]></AD_MODULE_ID>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <AD_DEPENDENT_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813151AEE1013151C4ACE6001B-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--FF8080813151AEE1013151C4ACE6001B-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <DEPENDANT_MODULE_NAME><![CDATA[Openbravo 3.0 Framework]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--FF8080813141B198013141B86DD70003-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--FF8080813141B198013141B86DD70003-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813141B198013141B86DD70003-->  <NAME><![CDATA[OpenID Service Integration]]></NAME>
-<!--FF8080813141B198013141B86DD70003-->  <VERSION><![CDATA[0.1.28860]]></VERSION>
+<!--FF8080813141B198013141B86DD70003-->  <VERSION><![CDATA[0.1.28838]]></VERSION>
 <!--FF8080813141B198013141B86DD70003-->  <DESCRIPTION><![CDATA[OpenID Service Integration]]></DESCRIPTION>
 <!--FF8080813141B198013141B86DD70003-->  <TYPE><![CDATA[M]]></TYPE>
 <!--FF8080813141B198013141B86DD70003-->  <LICENSE><![CDATA[Licensed under the Openbravo Public License Version 1.1.
@@ -19,7 +19,7 @@
 <!--FF8080813141B198013141B86DD70003-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--FF8080813141B198013141B86DD70003-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--FF8080813141B198013141B86DD70003-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--FF8080813141B198013141B86DD70003-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--FF8080813141B198013141B86DD70003-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--FF8080813141B198013141B86DD70003-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--FF8080813141B198013141B86DD70003-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--FF8080813141B198013141B86DD70003--></AD_MODULE>
--- a/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--FF8080813141B198013141B8B21B0006-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813141B198013141B8B21B0006-->  <AD_MODULE_ID><![CDATA[FF8080813141B198013141B86DD70003]]></AD_MODULE_ID>
 <!--FF8080813141B198013141B8B21B0006-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813141B198013141B8B21B0006-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--FF8080813141B198013141B8B21B0006-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--FF8080813141B198013141B8B21B0006-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080813141B198013141B8B21B0006-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813141B198013141B8B21B0006-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <NAME><![CDATA[JSON REST Webservice]]></NAME>
-<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION><![CDATA[2.0.28860]]></VERSION>
+<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION><![CDATA[2.0.28838]]></VERSION>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <DESCRIPTION><![CDATA[Provides a JSON REST webservice for CRUD service requests]]></DESCRIPTION>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <HELP><![CDATA[Provides a JSON REST webservice for CRUD service requests. Both the servlet implementation (receiving HTTP REST requests in JSON) as the backend processing are provided.]]></HELP>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <URL><![CDATA[http://forge.openbravo.com/projects/openbravojsonrest]]></URL>
@@ -22,7 +22,7 @@
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <UPDATEINFO><![CDATA[Bug fixing & new development for 3.0]]></UPDATEINFO>
-<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1--></AD_MODULE>
--- a/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--9E3E7B42DB16405FB794496D309D7044-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <AD_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_MODULE_ID>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--9E3E7B42DB16405FB794496D309D7044-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--9E3E7B42DB16405FB794496D309D7044-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Thu Jun 16 05:35:45 2016 +0000
@@ -136,7 +136,6 @@
         final OBQuery<BaseOBObject> obq = OBDal.getInstance().createQuery(entityName,
             JsonConstants.ID + " = :bobId");
         obq.setNamedParameter("bobId", id);
-        obq.setFilterOnActive(false);
         obq.setMaxResult(1);
         final BaseOBObject bob = obq.uniqueResult();
         if (bob != null) {
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonConstants.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonConstants.java	Thu Jun 16 05:35:45 2016 +0000
@@ -123,6 +123,4 @@
 
   public static final String IS_WS_CALL = "_isWsCall";
 
-  public static final String UNDEFINED = "undefined";
-  public static final String NULL = "null";
 }
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java	Thu Jun 16 05:35:45 2016 +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-2015 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -25,7 +25,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
@@ -392,18 +391,4 @@
     }
   }
 
-  /**
-   * Returns whether a JSON value is empty. The following values are considered as empty:
-   * <ul>
-   * <li>An empty string
-   * <li>{@code null}
-   * <li>{@code "null"} literal
-   * <li>{@code "undefined"} literal
-   * </ul>
-   */
-  public static boolean isValueEmpty(String value) {
-    return StringUtils.isEmpty(value) || JsonConstants.UNDEFINED.equals(value)
-        || JsonConstants.NULL.equals(value);
-  }
-
 }
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <NAME><![CDATA[User Interface Selector]]></NAME>
-<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION><![CDATA[2.1.28860]]></VERSION>
+<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION><![CDATA[2.1.28838]]></VERSION>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <DESCRIPTION><![CDATA[Provides a selector with a suggestion box and popup grid window]]></DESCRIPTION>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <HELP><![CDATA[The Openbravo selector provides new selector functionality which is used inside of existing Openbravo forms. The selector is mainly used for supporting foreign key references in the user interface. The selector combines both suggestion box behavior with a popup grid.]]></HELP>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <URL><![CDATA[http://forge.openbravo.com/projects/selector]]></URL>
@@ -22,7 +22,7 @@
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <UPDATEINFO><![CDATA[Bug fixing & new development for 3.0]]></UPDATEINFO>
-<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--5EB4F15C80684ACA904756BDC12ADBE5--></AD_MODULE>
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--38825CAED43941D38CA0C78DB04FCFA0-->  <STARTVERSION><![CDATA[8.1.28860]]></STARTVERSION>
+<!--38825CAED43941D38CA0C78DB04FCFA0-->  <STARTVERSION><![CDATA[8.1.28838]]></STARTVERSION>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <AD_DEPENDENT_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_DEPENDENT_MODULE_ID>
-<!--6DDE7B1A70174242AF82B5022FB89279-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--6DDE7B1A70174242AF82B5022FB89279-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Application]]></DEPENDANT_MODULE_NAME>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--94F9CD2CB5EF4467A67475C786C984A7-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--94F9CD2CB5EF4467A67475C786C984A7-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <STARTVERSION><![CDATA[1.1.28860]]></STARTVERSION>
+<!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <STARTVERSION><![CDATA[1.1.28838]]></STARTVERSION>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--C8DAC574B88649D08C9468521B343F12-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C8DAC574B88649D08C9468521B343F12-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--C8DAC574B88649D08C9468521B343F12-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--C8DAC574B88649D08C9468521B343F12-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--C8DAC574B88649D08C9468521B343F12-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--C8DAC574B88649D08C9468521B343F12-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--C8DAC574B88649D08C9468521B343F12-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--C8DAC574B88649D08C9468521B343F12-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--F14EB17946BE4724A46F80CB1A47EC70-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--F14EB17946BE4724A46F80CB1A47EC70-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <NAME><![CDATA[2.50 to 3.00 Compatibility Skin]]></NAME>
-<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION><![CDATA[2.0.28860]]></VERSION>
+<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION><![CDATA[2.0.28838]]></VERSION>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <DESCRIPTION><![CDATA[Skin module to proper visualization of classic windows inside the MDI interface]]></DESCRIPTION>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <HELP><![CDATA[With this skin module the classic windows styles will display in a way more coherent with the new 3.00 styles]]></HELP>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <URL><![CDATA[www.openbravo.com]]></URL>
@@ -23,7 +23,7 @@
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--96998CBC42744B3DBEE28AC8095C9335--></AD_MODULE>
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <AD_MODULE_ID><![CDATA[96998CBC42744B3DBEE28AC8095C9335]]></AD_MODULE_ID>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--39BF75AD9AB3453698BF5DE29E727AA9-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--39BF75AD9AB3453698BF5DE29E727AA9-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <NAME><![CDATA[Smartclient]]></NAME>
-<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION><![CDATA[8.1.28860]]></VERSION>
+<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION><![CDATA[8.1.28838]]></VERSION>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <DESCRIPTION><![CDATA[SmartClient libraries for use within Openbravo]]></DESCRIPTION>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <HELP><![CDATA[This module contains the SmartClient libraries for usage by other modules. It also contains some simple test pages to validate that SmartClient is working correctly. Also contains generic Openbravo SmartClient components]]></HELP>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <URL><![CDATA[http://forge.openbravo.com/projects/obsmartclient]]></URL>
@@ -23,7 +23,7 @@
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <UPDATEINFO><![CDATA[Bug fixing & new development for 3.0
 Updated to new SmartClient 8.3d 26-May-2012]]></UPDATEINFO>
-<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9--></AD_MODULE>
--- a/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--086331E18477496B8AC74D2CFEBD1307-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--086331E18477496B8AC74D2CFEBD1307-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--086331E18477496B8AC74D2CFEBD1307-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--DC5D4EF450244482BD2B458DAA496333-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--DC5D4EF450244482BD2B458DAA496333-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--DC5D4EF450244482BD2B458DAA496333-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--F2AF15C0AF5540E393D96BE506E20648-->  <STARTVERSION><![CDATA[1.1.28860]]></STARTVERSION>
+<!--F2AF15C0AF5540E393D96BE506E20648-->  <STARTVERSION><![CDATA[1.1.28838]]></STARTVERSION>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <NAME><![CDATA[Log Clean Up Utility]]></NAME>
-<!--8A34B301DC524EA3A07513DF9F42CC90-->  <VERSION><![CDATA[1.0.28860]]></VERSION>
+<!--8A34B301DC524EA3A07513DF9F42CC90-->  <VERSION><![CDATA[1.0.28838]]></VERSION>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <DESCRIPTION><![CDATA[Log Clean Up Utility]]></DESCRIPTION>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <HELP><![CDATA[Utility to periodically cleanup log tables]]></HELP>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <URL><![CDATA[http://centralrepository.openbravo.com/heartbeat-server/org.openbravo.forge.ui/ForgeProjectDetail?projectId=7DC25E3B7ADE426CAD71E7804B95C1BF]]></URL>
@@ -21,7 +21,7 @@
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
-<!--8A34B301DC524EA3A07513DF9F42CC90-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--8A34B301DC524EA3A07513DF9F42CC90-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--8A34B301DC524EA3A07513DF9F42CC90-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--8A34B301DC524EA3A07513DF9F42CC90--></AD_MODULE>
--- a/modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--86EBD30DEB8045508185B457896C9F6D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--86EBD30DEB8045508185B457896C9F6D-->  <AD_MODULE_ID><![CDATA[8A34B301DC524EA3A07513DF9F42CC90]]></AD_MODULE_ID>
 <!--86EBD30DEB8045508185B457896C9F6D-->  <AD_DEPENDENT_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_DEPENDENT_MODULE_ID>
-<!--86EBD30DEB8045508185B457896C9F6D-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--86EBD30DEB8045508185B457896C9F6D-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--86EBD30DEB8045508185B457896C9F6D-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--86EBD30DEB8045508185B457896C9F6D-->  <DEPENDANT_MODULE_NAME><![CDATA[Openbravo 3.0 Framework]]></DEPENDANT_MODULE_NAME>
 <!--86EBD30DEB8045508185B457896C9F6D-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <NAME><![CDATA[Standard Roles]]></NAME>
-<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION><![CDATA[3.0.28860]]></VERSION>
+<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION><![CDATA[3.0.28838]]></VERSION>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <DESCRIPTION><![CDATA[Pre-configured collection of standard ERP roles]]></DESCRIPTION>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <HELP><![CDATA[This dataset contains the following roles with their access to corresponding Openbravo entities - windows, reports, actions.
 * Employee - Any person of the enterprise
@@ -28,7 +28,7 @@
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <REFERENCEDATAINFO><![CDATA[Pre-configured collection of standard ERP roles]]></REFERENCEDATAINFO>
-<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61--></AD_MODULE>
--- a/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--148A000EE9A04A3CA653B1296A00B8E6-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--148A000EE9A04A3CA653B1296A00B8E6-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--30F966407A6F4E15965821BAEE34D25B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_DEPENDENT_MODULE_ID>
-<!--30F966407A6F4E15965821BAEE34D25B-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--30F966407A6F4E15965821BAEE34D25B-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <DEPENDANT_MODULE_NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></DEPENDANT_MODULE_NAME>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--F93CE30003B24F8F8886510B0065EECC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <AD_DEPENDENT_MODULE_ID><![CDATA[3A3A943684D64DEF9EC39F588A656848]]></AD_DEPENDENT_MODULE_ID>
-<!--F93CE30003B24F8F8886510B0065EECC-->  <STARTVERSION><![CDATA[1.1.28860]]></STARTVERSION>
+<!--F93CE30003B24F8F8886510B0065EECC-->  <STARTVERSION><![CDATA[1.1.28838]]></STARTVERSION>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <DEPENDANT_MODULE_NAME><![CDATA[Orders Awaiting Delivery]]></DEPENDANT_MODULE_NAME>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <NAME><![CDATA[Openbravo 3.0 Framework]]></NAME>
-<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION><![CDATA[2.1.28860]]></VERSION>
+<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION><![CDATA[2.1.28838]]></VERSION>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <DESCRIPTION><![CDATA[Openbravo 3.0 Framework]]></DESCRIPTION>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <HELP><![CDATA[Contains all the components required to run the Openbravo 3.0 framework]]></HELP>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <URL><![CDATA[http://forge.openbravo.com/projects/openbravov30framework]]></URL>
@@ -24,7 +24,7 @@
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <UPDATEINFO><![CDATA[minor bugfix release to include latest client.application 2.0.1, client.myob 2.0.2 and client.kernel 2.0.1]]></UPDATEINFO>
-<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--7E48CDD73B7E493A8BED4F7253E7C989--></AD_MODULE>
--- a/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--01E1BCCEC9114DE0960538DF34E30E6F-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--01E1BCCEC9114DE0960538DF34E30E6F-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <DEPENDANT_MODULE_NAME><![CDATA[My Openbravo Tab]]></DEPENDANT_MODULE_NAME>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--025B181F63CA47B48A920F6983242390-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--025B181F63CA47B48A920F6983242390-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--025B181F63CA47B48A920F6983242390-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--025B181F63CA47B48A920F6983242390-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--025B181F63CA47B48A920F6983242390-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--025B181F63CA47B48A920F6983242390-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--025B181F63CA47B48A920F6983242390-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--025B181F63CA47B48A920F6983242390-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_DEPENDENT_MODULE_ID>
-<!--054B4FEAF919478AA3FF27098A46D1D6-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--054B4FEAF919478AA3FF27098A46D1D6-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Application]]></DEPENDANT_MODULE_NAME>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_DEPENDENT_MODULE_ID>
-<!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <STARTVERSION><![CDATA[1.0.28860]]></STARTVERSION>
+<!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <STARTVERSION><![CDATA[1.0.28838]]></STARTVERSION>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <DEPENDANT_MODULE_NAME><![CDATA[Query/List Widget]]></DEPENDANT_MODULE_NAME>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--224754C3EF674C93B0D468F47BAAB824-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID>
-<!--224754C3EF674C93B0D468F47BAAB824-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--224754C3EF674C93B0D468F47BAAB824-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Selector]]></DEPENDANT_MODULE_NAME>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--5B72D24032DD4879A950194139D961B6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--5B72D24032DD4879A950194139D961B6-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--5B72D24032DD4879A950194139D961B6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--5B72D24032DD4879A950194139D961B6-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--5B72D24032DD4879A950194139D961B6-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--5B72D24032DD4879A950194139D961B6-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--5B72D24032DD4879A950194139D961B6-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME>
 <!--5B72D24032DD4879A950194139D961B6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -91,7 +91,7 @@
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <AD_DEPENDENT_MODULE_ID><![CDATA[D393BE6F22BB44B7B728259B34FC795A]]></AD_DEPENDENT_MODULE_ID>
-<!--8730CA6A4224439D82E0DD31B3806E36-->  <STARTVERSION><![CDATA[1.0.28860]]></STARTVERSION>
+<!--8730CA6A4224439D82E0DD31B3806E36-->  <STARTVERSION><![CDATA[1.0.28838]]></STARTVERSION>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <DEPENDANT_MODULE_NAME><![CDATA[HTML Widget]]></DEPENDANT_MODULE_NAME>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -105,7 +105,7 @@
 <!--98C47FF058F8413B8A2B26036061446E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--98C47FF058F8413B8A2B26036061446E-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--98C47FF058F8413B8A2B26036061446E-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--98C47FF058F8413B8A2B26036061446E-->  <STARTVERSION><![CDATA[8.1.28860]]></STARTVERSION>
+<!--98C47FF058F8413B8A2B26036061446E-->  <STARTVERSION><![CDATA[8.1.28838]]></STARTVERSION>
 <!--98C47FF058F8413B8A2B26036061446E-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--98C47FF058F8413B8A2B26036061446E-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--98C47FF058F8413B8A2B26036061446E-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -119,7 +119,7 @@
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <AD_DEPENDENT_MODULE_ID><![CDATA[96998CBC42744B3DBEE28AC8095C9335]]></AD_DEPENDENT_MODULE_ID>
-<!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <STARTVERSION><![CDATA[2.0.28860]]></STARTVERSION>
+<!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <STARTVERSION><![CDATA[2.0.28838]]></STARTVERSION>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <DEPENDANT_MODULE_NAME><![CDATA[2.50 to 3.00 Compatibility Skin]]></DEPENDANT_MODULE_NAME>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -133,7 +133,7 @@
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--A9CB99330AF34944877F889DD8A0AB3C-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--A9CB99330AF34944877F889DD8A0AB3C-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -147,7 +147,7 @@
 <!--E72A053A403C4A98A189C105B850ADB0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--E72A053A403C4A98A189C105B850ADB0-->  <STARTVERSION><![CDATA[1.1.28860]]></STARTVERSION>
+<!--E72A053A403C4A98A189C105B850ADB0-->  <STARTVERSION><![CDATA[1.1.28838]]></STARTVERSION>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -161,7 +161,7 @@
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_DEPENDENT_MODULE_ID>
-<!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <STARTVERSION><![CDATA[2.0.28860]]></STARTVERSION>
+<!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <STARTVERSION><![CDATA[2.0.28838]]></STARTVERSION>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON REST Webservice]]></DEPENDANT_MODULE_NAME>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <NAME><![CDATA[Openbravo 3.0]]></NAME>
-<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION><![CDATA[3.0.28860]]></VERSION>
+<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION><![CDATA[3.0.28838]]></VERSION>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <DESCRIPTION><![CDATA[Openbravo 3.0 distribution template]]></DESCRIPTION>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <HELP><![CDATA[Openbravo 3.0 is a collection (distribution) of modules. This template is a container of all the modules and configuration changes that compose Openbravo 3.0.]]></HELP>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <URL><![CDATA[http://forge.openbravo.com/projects/vthree]]></URL>
@@ -20,7 +20,7 @@
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--0138E7A89B5E4DC3932462252801FFBC--></AD_MODULE>
--- a/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -7,7 +7,7 @@
 <!--48D556894CE54CF998DC97882E904CBD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--48D556894CE54CF998DC97882E904CBD-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--48D556894CE54CF998DC97882E904CBD-->  <AD_DEPENDENT_MODULE_ID><![CDATA[8A098711BB324335A19833286BDB093D]]></AD_DEPENDENT_MODULE_ID>
-<!--48D556894CE54CF998DC97882E904CBD-->  <STARTVERSION><![CDATA[1.0.28860]]></STARTVERSION>
+<!--48D556894CE54CF998DC97882E904CBD-->  <STARTVERSION><![CDATA[1.0.28838]]></STARTVERSION>
 <!--48D556894CE54CF998DC97882E904CBD-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--48D556894CE54CF998DC97882E904CBD-->  <DEPENDANT_MODULE_NAME><![CDATA[Apache External Connection Pool]]></DEPENDANT_MODULE_NAME>
 <!--48D556894CE54CF998DC97882E904CBD-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--4D11E3A70650475381139522373CD191-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--4D11E3A70650475381139522373CD191-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--4D11E3A70650475381139522373CD191-->  <AD_DEPENDENT_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_DEPENDENT_MODULE_ID>
-<!--4D11E3A70650475381139522373CD191-->  <STARTVERSION><![CDATA[2.1.28860]]></STARTVERSION>
+<!--4D11E3A70650475381139522373CD191-->  <STARTVERSION><![CDATA[2.1.28838]]></STARTVERSION>
 <!--4D11E3A70650475381139522373CD191-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--4D11E3A70650475381139522373CD191-->  <DEPENDANT_MODULE_NAME><![CDATA[Openbravo 3.0 Framework]]></DEPENDANT_MODULE_NAME>
 <!--4D11E3A70650475381139522373CD191-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_DEPENDENT_MODULE_ID>
-<!--52CE523C40634C47A99C6EBBD9C3125C-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--52CE523C40634C47A99C6EBBD9C3125C-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <DEPENDANT_MODULE_NAME><![CDATA[Payment Report]]></DEPENDANT_MODULE_NAME>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--60834727BB114764ACEF019F40A34562-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--60834727BB114764ACEF019F40A34562-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--60834727BB114764ACEF019F40A34562-->  <AD_DEPENDENT_MODULE_ID><![CDATA[3A3A943684D64DEF9EC39F588A656848]]></AD_DEPENDENT_MODULE_ID>
-<!--60834727BB114764ACEF019F40A34562-->  <STARTVERSION><![CDATA[1.1.28860]]></STARTVERSION>
+<!--60834727BB114764ACEF019F40A34562-->  <STARTVERSION><![CDATA[1.1.28838]]></STARTVERSION>
 <!--60834727BB114764ACEF019F40A34562-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--60834727BB114764ACEF019F40A34562-->  <DEPENDANT_MODULE_NAME><![CDATA[Orders Awaiting Delivery]]></DEPENDANT_MODULE_NAME>
 <!--60834727BB114764ACEF019F40A34562-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--8418885E97D643138B6D907671351E3D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8418885E97D643138B6D907671351E3D-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--8418885E97D643138B6D907671351E3D-->  <AD_DEPENDENT_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_DEPENDENT_MODULE_ID>
-<!--8418885E97D643138B6D907671351E3D-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--8418885E97D643138B6D907671351E3D-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--8418885E97D643138B6D907671351E3D-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--8418885E97D643138B6D907671351E3D-->  <DEPENDANT_MODULE_NAME><![CDATA[Standard Roles]]></DEPENDANT_MODULE_NAME>
 <!--8418885E97D643138B6D907671351E3D-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--A32F3279B3374FC0A6CFEA2368BB7053-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--A32F3279B3374FC0A6CFEA2368BB7053-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MINOR]]></DEPENDENCY_ENFORCEMENT>
@@ -91,7 +91,7 @@
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_DEPENDENT_MODULE_ID>
-<!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <STARTVERSION><![CDATA[3.0.28860]]></STARTVERSION>
+<!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <STARTVERSION><![CDATA[3.0.28838]]></STARTVERSION>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <DEPENDANT_MODULE_NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></DEPENDANT_MODULE_NAME>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -105,7 +105,7 @@
 <!--FEF6E40F244A4061B7C62CB755663712-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FEF6E40F244A4061B7C62CB755663712-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FEF6E40F244A4061B7C62CB755663712-->  <AD_DEPENDENT_MODULE_ID><![CDATA[8A34B301DC524EA3A07513DF9F42CC90]]></AD_DEPENDENT_MODULE_ID>
-<!--FEF6E40F244A4061B7C62CB755663712-->  <STARTVERSION><![CDATA[1.0.28860]]></STARTVERSION>
+<!--FEF6E40F244A4061B7C62CB755663712-->  <STARTVERSION><![CDATA[1.0.28838]]></STARTVERSION>
 <!--FEF6E40F244A4061B7C62CB755663712-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FEF6E40F244A4061B7C62CB755663712-->  <DEPENDANT_MODULE_NAME><![CDATA[Log Clean Up Utility]]></DEPENDANT_MODULE_NAME>
 <!--FEF6E40F244A4061B7C62CB755663712-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -119,7 +119,7 @@
 <!--FF8080813189932B013189B45B59003A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813189932B013189B45B59003A-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8080813189932B013189B45B59003A-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080813141B198013141B86DD70003]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813189932B013189B45B59003A-->  <STARTVERSION><![CDATA[0.1.28860]]></STARTVERSION>
+<!--FF8080813189932B013189B45B59003A-->  <STARTVERSION><![CDATA[0.1.28838]]></STARTVERSION>
 <!--FF8080813189932B013189B45B59003A-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8080813189932B013189B45B59003A-->  <DEPENDANT_MODULE_NAME><![CDATA[OpenID Service Integration]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813189932B013189B45B59003A-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -133,7 +133,7 @@
 <!--FF8080813189932B013189B4C00F003D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813189932B013189B4C00F003D-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8080813189932B013189B4C00F003D-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080813129ADA401312CA1222A0005]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813189932B013189B4C00F003D-->  <STARTVERSION><![CDATA[0.1.28860]]></STARTVERSION>
+<!--FF8080813189932B013189B4C00F003D-->  <STARTVERSION><![CDATA[0.1.28838]]></STARTVERSION>
 <!--FF8080813189932B013189B4C00F003D-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8080813189932B013189B4C00F003D-->  <DEPENDANT_MODULE_NAME><![CDATA[Integration with Google APIs]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813189932B013189B4C00F003D-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -147,7 +147,7 @@
 <!--FF8081812E2F6F3C012E2F750109001C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080812D842086012D844F3CC0003E]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8081812E2F6F3C012E2F750109001C-->  <STARTVERSION><![CDATA[0.0.28860]]></STARTVERSION>
+<!--FF8081812E2F6F3C012E2F750109001C-->  <STARTVERSION><![CDATA[0.0.28838]]></STARTVERSION>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <DEPENDANT_MODULE_NAME><![CDATA[Widgets Collection]]></DEPENDANT_MODULE_NAME>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/src-db/database/model/functions/C_GET_SERVICE_AMOUNT.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/model/functions/C_GET_SERVICE_AMOUNT.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -33,59 +33,64 @@
   Cur_Rule RECORD;
   Cur_Range RECORD;
   BEGIN
-    SELECT SUM(AMOUNT), SUM(QUANTITY), ISPRICERULEBASED, M_PRODUCT.M_PRODUCT_ID, C_ORDER.DATEORDERED, STDPRECISION, C_ORDER.M_PRICELIST_ID
-      INTO v_TotalAmount, v_TotalQantity, v_IsPriceRuleBased, v_M_Product_ID,  v_Dateordered, v_stdPrecision, v_OrderPricelist
-    FROM C_ORDERLINE_SERVICERELATION, C_ORDERLINE, M_PRODUCT, C_ORDER, C_CURRENCY
-    WHERE C_ORDERLINE_SERVICERELATION.C_ORDERLINE_ID = C_ORDERLINE.C_ORDERLINE_ID
-    AND C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID
-    AND C_ORDER.C_CURRENCY_ID =  C_CURRENCY.C_CURRENCY_ID
-    AND C_ORDERLINE.M_PRODUCT_id =  M_PRODUCT.M_PRODUCT_ID
-    AND C_ORDERLINE.C_ORDERLINE_ID =  v_c_orderline_id
-    GROUP BY ISPRICERULEBASED, M_PRODUCT.M_PRODUCT_ID, C_ORDER.DATEORDERED, STDPRECISION, C_ORDER.M_PRICELIST_ID;
+  
+    
+  
+		SELECT SUM(AMOUNT), SUM(QUANTITY), ISPRICERULEBASED, M_PRODUCT.M_PRODUCT_ID, C_ORDER.DATEORDERED, STDPRECISION, C_ORDER.M_PRICELIST_ID
+		INTO v_TotalAmount, v_TotalQantity, v_IsPriceRuleBased, v_M_Product_ID,  v_Dateordered, v_stdPrecision, 	v_OrderPricelist
+		FROM C_ORDERLINE_SERVICERELATION, C_ORDERLINE, M_PRODUCT, C_ORDER, C_CURRENCY
+		WHERE C_ORDERLINE_SERVICERELATION.C_ORDERLINE_ID = C_ORDERLINE.C_ORDERLINE_ID
+		AND C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID
+		AND C_ORDER.C_CURRENCY_ID =  C_CURRENCY.C_CURRENCY_ID
+		AND C_ORDERLINE.M_PRODUCT_id =  M_PRODUCT.M_PRODUCT_ID
+		AND C_ORDERLINE.C_ORDERLINE_ID =  v_c_orderline_id
+		GROUP BY ISPRICERULEBASED, M_PRODUCT.M_PRODUCT_ID, C_ORDER.DATEORDERED, STDPRECISION, C_ORDER.M_PRICELIST_ID;
 		
     IF(v_IsPriceRuleBased = 'Y') THEN
-      FOR Cur_Rule IN
-	(SELECT  RULETYPE, AFTERDISCOUNTS, PERCENTAGE, M_SERVICEPRICERULE.M_SERVICEPRICERULE_ID
-	 FROM M_SERVICEPRICERULE_VERSION, M_SERVICEPRICERULE
-	 WHERE M_SERVICEPRICERULE_VERSION.M_SERVICEPRICERULE_ID =  M_SERVICEPRICERULE.M_SERVICEPRICERULE_ID
-	 AND M_PRODUCT_ID = v_M_Product_ID
-	 AND VALIDFROM <=  v_Dateordered
-	 ORDER BY VALIDFROM DESC
-	)
-      LOOP
-        IF(Cur_Rule.RULETYPE = 'P') THEN
-          RETURN  round(v_TotalAmount * Cur_Rule.percentage / 100, v_stdPrecision);
-        ELSE
-	  FOR Cur_Range IN
-            (SELECT  RULETYPE, AFTERDISCOUNTS, PERCENTAGE, M_PRICELIST_ID
-	     FROM m_servicepricerule_range
-	     WHERE m_servicepricerule_ID  = Cur_Rule.M_SERVICEPRICERULE_ID
-	     AND coalesce(amountupto, v_TotalAmount)  >=  v_TotalAmount
-	     ORDER BY amountupto
-	    )
-	  LOOP
-	    IF(Cur_Range.RULETYPE = 'P') THEN
-	      RETURN  ROUND(v_TotalAmount * Cur_Range.percentage / 100, v_stdPrecision);
-	    ELSE
-	      SELECT PRICELIST 
-		INTO v_PriceList
-	      FROM M_PRODUCTPRICE
-	      WHERE M_PRICELIST_VERSION_ID = M_GET_PRICELIST_VERSION(Cur_Range.M_PRICELIST_ID, v_Dateordered)
-	      AND M_PRODUCT_ID = v_M_Product_ID;
-              RETURN ROUND(v_PriceList * v_TotalQantity, v_stdPrecision);
-	    END IF;
-	  END LOOP;
-	  RAISE_APPLICATION_ERROR(-20000, '@NoMatchingRange@');
-        END IF;
-      END LOOP;
-      RAISE_APPLICATION_ERROR(-20000, '@NoMatchingPriceRule@');
-    ELSE
-      SELECT PRICELIST 
-        INTO v_PriceList
-      FROM M_PRODUCTPRICE
-      WHERE M_PRICELIST_VERSION_ID = M_GET_PRICELIST_VERSION(v_OrderPricelist, v_Dateordered)
-      AND M_PRODUCT_ID = v_M_Product_ID;
-      RETURN ROUND(v_PriceList * v_TotalQantity, v_stdPrecision);
+          FOR Cur_Rule IN
+			      (
+						SELECT  RULETYPE, AFTERDISCOUNTS, PERCENTAGE, M_SERVICEPRICERULE.M_SERVICEPRICERULE_ID
+						FROM M_SERVICEPRICERULE_VERSION, M_SERVICEPRICERULE
+						WHERE M_SERVICEPRICERULE_VERSION.M_SERVICEPRICERULE_ID =  M_SERVICEPRICERULE.M_SERVICEPRICERULE_ID
+						AND M_PRODUCT_ID = v_M_Product_ID
+						AND VALIDFROM <=  v_Dateordered
+						ORDER BY VALIDFROM DESC
+			      )
+			    LOOP
+            IF(Cur_Rule.RULETYPE = 'P') THEN
+              RETURN  round(v_TotalAmount * Cur_Rule.percentage / 100, v_stdPrecision);
+            ELSE
+			          FOR Cur_Range IN
+						      (
+									SELECT  RULETYPE, AFTERDISCOUNTS, PERCENTAGE, M_PRICELIST_ID
+									FROM m_servicepricerule_range
+									WHERE m_servicepricerule_ID  = Cur_Rule.M_SERVICEPRICERULE_ID
+									AND coalesce(amountupto, v_TotalAmount)  >=  v_TotalAmount
+									ORDER BY amountupto
+						      )
+						    LOOP
+			            IF(Cur_Range.RULETYPE = 'P') THEN
+			              RETURN  ROUND(v_TotalAmount * Cur_Range.percentage / 100, v_stdPrecision);
+			            ELSE
+			              SELECT PRICELIST 
+			              INTO v_PriceList
+			              FROM M_PRODUCTPRICE
+			              WHERE M_PRICELIST_VERSION_ID = M_GET_PRICELIST_VERSION(Cur_Range.M_PRICELIST_ID, v_Dateordered)
+			              AND M_PRODUCT_ID = v_M_Product_ID;
+                    RETURN ROUND(v_PriceList * v_TotalQantity, v_stdPrecision);
+			            END IF;
+						    END LOOP;
+						    RAISE_APPLICATION_ERROR(-20000, '@NoMatchingRange@');
+            END IF;
+			    END LOOP;
+			    RAISE_APPLICATION_ERROR(-20000, '@NoMatchingPriceRule@');
+		ELSE
+			SELECT PRICELIST 
+			INTO v_PriceList
+			FROM M_PRODUCTPRICE
+			WHERE M_PRICELIST_VERSION_ID = M_GET_PRICELIST_VERSION(v_OrderPricelist, v_Dateordered)
+			AND M_PRODUCT_ID = v_M_Product_ID;
+			RETURN ROUND(v_PriceList * v_TotalQantity, v_stdPrecision);
     END IF;
 END C_GET_SERVICE_AMOUNT
 ]]></body>
--- a/src-db/database/model/functions/C_ORDER_POST1.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -181,16 +181,17 @@
     END LOOP;
   ELSE
      IF (v_DocAction IN ('CO', 'PR')) THEN
-       SELECT COUNT(1) 
-         INTO v_Count
-       FROM DUAL 
-       WHERE EXISTS(SELECT 1
-		      FROM C_ORDERLINE, M_PRODUCT
-		      WHERE C_ORDERLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID 
-		      AND ISLINKEDTOPRODUCT = 'Y'
-		      AND C_ORDER_ID = v_Record_ID
-		      AND NOT EXISTS (SELECT 1 FROM C_ORDERLINE_SERVICERELATION WHERE C_ORDERLINE_SERVICERELATION.C_ORDERLINE_ID = C_ORDERLINE.C_ORDERLINE_ID));
-       IF (v_Count <> 0) THEN
+				SELECT COUNT(1) 
+				INTO v_Count
+				FROM DUAL 
+				WHERE EXISTS(
+											SELECT 1
+											FROM C_ORDERLINE, M_PRODUCT
+											WHERE C_ORDERLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID 
+											AND ISLINKEDTOPRODUCT = 'Y'
+											AND C_ORDER_ID = v_Record_ID
+											AND NOT EXISTS (SELECT 1 FROM C_ORDERLINE_SERVICERELATION WHERE C_ORDERLINE_SERVICERELATION.C_ORDERLINE_ID = C_ORDERLINE.C_ORDERLINE_ID));
+			 IF (v_Count <> 0) THEN
          v_Message:='@MissingServiceRelation@';
          RAISE_APPLICATION_ERROR(-20000, '@MissingServiceRelation@') ;
        END IF;
@@ -367,25 +368,12 @@
     */
     IF (v_DocAction = 'CO' OR v_DocAction = 'PR') THEN
       SELECT COUNT(*)
-      INTO v_Aux
-      FROM C_ORDERLINE
-      WHERE C_ORDER_ID = v_Record_ID;
-      IF (v_Aux = 0) THEN
-        RAISE_APPLICATION_ERROR(-20000, '@OrderWithoutLines@');
-      END IF;
-    END IF;
-
-    /**
-    * Check if already processed / reactivated
-    */
-    IF (v_DocAction = 'CO' OR v_DocAction = 'PR') THEN
-      IF (v_IsProcessed = 'Y') THEN
-        RAISE_APPLICATION_ERROR(-20000,'@AlreadyPosted@');
-      END IF;
-    ELSIF (v_DocAction='RE') THEN
-      IF (v_IsProcessed = 'N') THEN
-        RAISE_APPLICATION_ERROR(-20000,'@ActionNotSupported@');
-      END IF;
+        INTO v_Aux
+       FROM C_ORDERLINE
+       WHERE C_ORDER_ID = v_Record_ID;
+       IF v_Aux=0 THEN
+         RAISE_APPLICATION_ERROR(-20000, '@OrderWithoutLines@');
+       END IF;
     END IF;
 
     -- Check the cash vat flag for all the taxes matches the order one
--- a/src-db/database/model/triggers/C_INVOICELINE_TRG.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/model/triggers/C_INVOICELINE_TRG.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -14,7 +14,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) 2001-2016 Openbravo SLU
+* All portions are Copyright (C) 2001-2015 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -39,6 +39,8 @@
  v_CinvoiceTaxID varchar2(32);
  v_AttrSetValueType M_Product.AttrSetValueType%TYPE;
  v_count NUMBER;
+ v_IsCashVAT_Tax C_Tax.IsCashVAT%TYPE;
+ v_IsCashVAT_Invoice C_Invoice.IsCashVAT%TYPE;
     
 BEGIN
     
@@ -100,6 +102,38 @@
   END IF;
  END IF;
 
+
+ -- Update C_Invoice.IsCashVAT flag from the line tax rate.
+ -- We do it this way to force any invoicing process to properly set the C_Invoice.IsCashVAT
+ -- If a user manually changes the tax rate when entering a line, the invoice's header IsCash VAT may change
+ IF (INSERTING OR UPDATING) THEN
+  IF (:NEW.C_TAX_ID IS NOT NULL) THEN
+   SELECT CASE WHEN COUNT(*) > 0 THEN 'Y' ELSE 'N' END
+   INTO v_IsCashVAT_Tax
+   FROM dual
+   WHERE EXISTS (
+        select 1
+        from c_tax t
+        where C_TAX_ISMEMBER(:NEW.C_Tax_ID, t.c_tax_id) = 1
+        and t.isCashVAT = 'Y'
+        and t.rate <> 0
+        and t.isSummary = 'N'
+                 );
+
+   SELECT COALESCE(IsCashVAT, 'N')
+   INTO v_IsCashVAT_Invoice
+   FROM C_Invoice
+   WHERE C_Invoice_ID=:NEW.C_Invoice_ID;
+
+   IF (v_IsCashVAT_Tax <> v_IsCashVAT_Invoice) THEN
+     UPDATE C_Invoice
+     SET IsCashVAT = v_IsCashVAT_Tax
+     WHERE C_Invoice_ID=:NEW.C_Invoice_ID;
+   END IF;
+  END IF;
+ END IF;
+
+
 END C_INVOICELINE_TRG
 ]]></body>
     </trigger>
--- a/src-db/database/model/triggers/C_INVOICETAX_TRG.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/model/triggers/C_INVOICETAX_TRG.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -17,7 +17,7 @@
     * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
     * All Rights Reserved.
     * Contributor(s): Openbravo SLU
-    * Contributions are Copyright (C) 2001-2016 Openbravo, S.L.U.
+    * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
     *
     * Specifically, this derivative work is based upon the following Compiere
     * file and version.
@@ -30,10 +30,7 @@
   v_ID VARCHAR2(32);
   v_RO        NUMBER;
   v_Processed VARCHAR(60) ;
-  v_IsCashVAT_Tax C_Tax.IsCashVAT%TYPE;
-  v_IsCashVAT_Invoice C_Invoice.IsCashVAT%TYPE;
-  v_IsWithholding_Tax C_Tax.IsWithholdingTax%TYPE;
-  v_Rate_Tax C_Tax.Rate%TYPE;
+    
 BEGIN
     
     IF AD_isTriggerEnabled()='N' THEN RETURN;
@@ -70,30 +67,6 @@
   IF(v_RO > 0) THEN
     RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
   END IF;
-
- -- Update C_Invoice.IsCashVAT flag from the line tax rate.
- -- We do it this way to force any invoicing process to properly set the C_Invoice.IsCashVAT
- -- If a user manually changes the tax rate when entering a line, the invoice's header IsCash VAT may change
-  IF (INSERTING OR UPDATING) THEN
-    IF (:NEW.C_TAX_ID IS NOT NULL) THEN
-      SELECT COALESCE(iswithholdingtax, 'N'), COALESCE(rate, 0), COALESCE(iscashvat,'N')
-      INTO v_IsWithholding_Tax, v_Rate_Tax, v_IsCashVAT_Tax
-      FROM C_Tax
-      WHERE C_Tax_ID=:NEW.C_Tax_ID;
-
-      IF(v_IsWithholding_Tax='N' AND v_Rate_Tax<>0) THEN
-        SELECT COALESCE(IsCashVAT, 'N')
-        INTO v_IsCashVAT_Invoice
-        FROM C_Invoice
-        WHERE C_Invoice_ID=:NEW.C_Invoice_ID;
-        IF (v_IsCashVAT_Tax <> v_IsCashVAT_Invoice) THEN
-          UPDATE C_Invoice
-          SET IsCashVAT = v_IsCashVAT_Tax
-          WHERE C_Invoice_ID=:NEW.C_Invoice_ID;
-        END IF;
-      END IF;
-    END IF;
-  END IF;
 END C_INVOICETAX_TRG
 ]]></body>
     </trigger>
--- a/src-db/database/model/triggers/C_ORDERLINE_TRG.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/model/triggers/C_ORDERLINE_TRG.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -17,7 +17,7 @@
   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
   * All Rights Reserved.
   * Contributor(s): Openbravo SLU
-  * Contributions are Copyright (C) 2001-2016 Openbravo, S.L.U.
+  * Contributions are Copyright (C) 2001-2015 Openbravo, S.L.U.
   *
   * Specifically, this derivative work is based upon the following Compiere
   * file and version.
@@ -32,6 +32,8 @@
   v_CountRelations NUMBER;
   v_reservation_id    VARCHAR2(32);
   v_prereservedqty    NUMBER;
+  v_IsCashVAT_Tax C_Tax.IsCashVAT%TYPE;
+  v_IsCashVAT_Order C_Order.IsCashVAT%TYPE;
   v_istaxincluded CHAR(1);
   v_PriceActual NUMBER;
   
@@ -50,8 +52,7 @@
   v_CalcLine NUMBER;
           
   TYPE RECORD IS REF CURSOR;
-  Cur_BOM RECORD;
-
+  Cur_BOM RECORD;         
 BEGIN
     
     IF AD_isTriggerEnabled()='N' THEN RETURN;
@@ -252,6 +253,36 @@
   :new.ChargeAmt := ROUND(:new.ChargeAmt, v_Prec);  
  END IF;
 
+ -- Update C_Order.IsCashVAT flag from the line tax rate.
+ -- We do it this way to force any process that creates Orders to properly set the C_Order.IsCashVAT
+ -- If a user manually changes the tax rate when entering a line, the order's header IsCash VAT may change
+ IF (INSERTING OR UPDATING) THEN
+  IF (:NEW.C_TAX_ID IS NOT NULL) THEN  
+   SELECT CASE WHEN COUNT(*) > 0 THEN 'Y' ELSE 'N' END
+   INTO v_IsCashVAT_Tax
+   FROM dual
+   WHERE EXISTS (
+        select 1
+        from c_tax t
+        where C_TAX_ISMEMBER(:NEW.C_Tax_ID, t.c_tax_id) = 1
+        and t.isCashVAT = 'Y'
+        and t.rate <> 0
+        and t.isSummary = 'N'
+                 );
+
+   SELECT COALESCE(IsCashVAT, 'N')
+   INTO v_IsCashVAT_Order
+   FROM C_Order
+   WHERE C_Order_ID=:NEW.C_Order_ID;
+
+   IF (v_IsCashVAT_Tax <> v_IsCashVAT_Order) THEN
+     UPDATE C_Order
+     SET IsCashVAT = v_IsCashVAT_Tax
+     WHERE C_Order_ID=:NEW.C_Order_ID;
+   END IF;
+  END IF;
+ END IF;
+
 END C_ORDERLINE_TRG
 ]]></body>
     </trigger>
--- a/src-db/database/model/triggers/C_ORDERTAX_TRG.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/model/triggers/C_ORDERTAX_TRG.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -17,7 +17,7 @@
     * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
     * All Rights Reserved.
     * Contributor(s): Openbravo SLU
-    * Contributions are Copyright (C) 2001-2016 Openbravo, S.L.U.
+    * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
     *
     * Specifically, this derivative work is based upon the following Compiere
     * file and version.
@@ -32,10 +32,6 @@
   v_Processed  VARCHAR(60) ;
   v_C_ORDER_ID VARCHAR2(32) ;
   v_Docaction VARCHAR(60) ;
-  v_IsWithholding_Tax C_Tax.IsWithholdingTax%TYPE;
-  v_Rate_Tax C_Tax.Rate%TYPE;
-  v_IsCashVAT_Tax C_Tax.IsCashVAT%TYPE;
-  v_IsCashVAT_Order C_Order.IsCashVAT%TYPE;
     
 BEGIN
     
@@ -86,31 +82,6 @@
   RAISE_APPLICATION_ERROR(-20000, '@20501@');
   END IF;
   **/
- -- Update C_Order.IsCashVAT flag from the line tax rate.
- -- We do it this way to force any process that creates Orders to properly set the C_Order.IsCashVAT
- -- If a user manually changes the tax rate when entering a line, the order's header IsCash VAT may change
- IF (INSERTING OR UPDATING) THEN
-   IF (:NEW.C_TAX_ID IS NOT NULL) THEN
-     SELECT COALESCE(iswithholdingtax, 'N'), COALESCE(rate, 0), COALESCE(IsCashVat, 'N')
-     INTO v_IsWithholding_Tax, v_Rate_Tax, v_IsCashVAT_Tax
-     FROM C_Tax
-     WHERE C_Tax_ID=:NEW.C_Tax_ID;
-
-     IF (v_IsWithholding_Tax='N' AND v_Rate_Tax<>0) THEN
-       SELECT COALESCE(IsCashVAT, 'N')
-       INTO v_IsCashVAT_Order
-       FROM C_Order
-       WHERE C_Order_ID=:NEW.C_Order_ID;
-
-       IF (v_IsCashVAT_Tax <> v_IsCashVAT_Order) THEN
-         UPDATE C_Order
-         SET IsCashVAT = v_IsCashVAT_Tax
-         WHERE C_Order_ID=:NEW.C_Order_ID;
-       END IF;
-     END IF;
-   END IF;
- END IF;
-
 END C_ORDERTAX_TRG
 ]]></body>
     </trigger>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -256525,8 +256525,6 @@
 <!--481DD00275E04E569EC34D3E634249A3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--481DD00275E04E569EC34D3E634249A3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--481DD00275E04E569EC34D3E634249A3-->  <NAME><![CDATA[linkedToProduct]]></NAME>
-<!--481DD00275E04E569EC34D3E634249A3-->  <DESCRIPTION><![CDATA[The service can be linked to a Product]]></DESCRIPTION>
-<!--481DD00275E04E569EC34D3E634249A3-->  <HELP><![CDATA[The service can be linked to a Product. If so, when adding the product to a Sales Order, the related service product could be added to the Sales Order also, following special rules to set the quantity to be added and the price of the service, both of them based on the product.]]></HELP>
 <!--481DD00275E04E569EC34D3E634249A3-->  <COLUMNNAME><![CDATA[Islinkedtoproduct]]></COLUMNNAME>
 <!--481DD00275E04E569EC34D3E634249A3-->  <AD_TABLE_ID><![CDATA[208]]></AD_TABLE_ID>
 <!--481DD00275E04E569EC34D3E634249A3-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
@@ -339708,10 +339706,7 @@
 <!--BD52841FB8554ED8B347EDDD9A48D00E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--BD52841FB8554ED8B347EDDD9A48D00E-->  <NAME><![CDATA[RecalculatePermissions]]></NAME>
 <!--BD52841FB8554ED8B347EDDD9A48D00E-->  <DESCRIPTION><![CDATA[Recalculate Permissions]]></DESCRIPTION>
-<!--BD52841FB8554ED8B347EDDD9A48D00E-->  <HELP><![CDATA[This process recalculates role permissions, based on the role inheritance defined. Depending on the role type the behavior varies:
-- If the role is a template one, the permissions for the role will be recalculated and also propagated to every role which is currently inheriting from this template.
-- If the role is not marked as template, just the permissions for this role are recalculated.
-For details - http://wiki.openbravo.com/wiki/Role#Permissions_Inheritance]]></HELP>
+<!--BD52841FB8554ED8B347EDDD9A48D00E-->  <HELP><![CDATA[A process which recalculates role permissions using role inheritance]]></HELP>
 <!--BD52841FB8554ED8B347EDDD9A48D00E-->  <COLUMNNAME><![CDATA[Recalculatepermissions]]></COLUMNNAME>
 <!--BD52841FB8554ED8B347EDDD9A48D00E-->  <AD_TABLE_ID><![CDATA[156]]></AD_TABLE_ID>
 <!--BD52841FB8554ED8B347EDDD9A48D00E-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -26230,8 +26230,6 @@
 <!--680E69F4E5C8492BA0897166B5C54926-->  <COLUMNNAME><![CDATA[Islinkedtoproduct]]></COLUMNNAME>
 <!--680E69F4E5C8492BA0897166B5C54926-->  <NAME><![CDATA[Linked To Product]]></NAME>
 <!--680E69F4E5C8492BA0897166B5C54926-->  <PRINTNAME><![CDATA[Linked To Product]]></PRINTNAME>
-<!--680E69F4E5C8492BA0897166B5C54926-->  <DESCRIPTION><![CDATA[The service can be linked to a Product]]></DESCRIPTION>
-<!--680E69F4E5C8492BA0897166B5C54926-->  <HELP><![CDATA[The service can be linked to a Product. If so, when adding the product to a Sales Order, the related service product could be added to the Sales Order also, following special rules to set the quantity to be added and the price of the service, both of them based on the product.]]></HELP>
 <!--680E69F4E5C8492BA0897166B5C54926-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--680E69F4E5C8492BA0897166B5C54926-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--680E69F4E5C8492BA0897166B5C54926--></AD_ELEMENT>
@@ -33475,10 +33473,7 @@
 <!--DE965C6322B04FCAAC6DDCB4334CE52A-->  <NAME><![CDATA[Recalculate Permissions]]></NAME>
 <!--DE965C6322B04FCAAC6DDCB4334CE52A-->  <PRINTNAME><![CDATA[Recalculate Permissions]]></PRINTNAME>
 <!--DE965C6322B04FCAAC6DDCB4334CE52A-->  <DESCRIPTION><![CDATA[Recalculate Permissions]]></DESCRIPTION>
-<!--DE965C6322B04FCAAC6DDCB4334CE52A-->  <HELP><![CDATA[This process recalculates role permissions, based on the role inheritance defined. Depending on the role type the behavior varies:
-- If the role is a template one, the permissions for the role will be recalculated and also propagated to every role which is currently inheriting from this template.
-- If the role is not marked as template, just the permissions for this role are recalculated.
-For details - http://wiki.openbravo.com/wiki/Role#Permissions_Inheritance]]></HELP>
+<!--DE965C6322B04FCAAC6DDCB4334CE52A-->  <HELP><![CDATA[A process which recalculates role permissions using role inheritance]]></HELP>
 <!--DE965C6322B04FCAAC6DDCB4334CE52A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--DE965C6322B04FCAAC6DDCB4334CE52A-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--DE965C6322B04FCAAC6DDCB4334CE52A--></AD_ELEMENT>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -236956,8 +236956,6 @@
 <!--7A007009BDAE4E8290430EEC81CB434C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--7A007009BDAE4E8290430EEC81CB434C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--7A007009BDAE4E8290430EEC81CB434C-->  <NAME><![CDATA[Linked To Product]]></NAME>
-<!--7A007009BDAE4E8290430EEC81CB434C-->  <DESCRIPTION><![CDATA[The service can be linked to a Product]]></DESCRIPTION>
-<!--7A007009BDAE4E8290430EEC81CB434C-->  <HELP><![CDATA[The service can be linked to a Product. If so, when adding the product to a Sales Order, the related service product could be added to the Sales Order also, following special rules to set the quantity to be added and the price of the service, both of them based on the product.]]></HELP>
 <!--7A007009BDAE4E8290430EEC81CB434C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--7A007009BDAE4E8290430EEC81CB434C-->  <AD_TAB_ID><![CDATA[180]]></AD_TAB_ID>
 <!--7A007009BDAE4E8290430EEC81CB434C-->  <AD_COLUMN_ID><![CDATA[481DD00275E04E569EC34D3E634249A3]]></AD_COLUMN_ID>
@@ -302511,15 +302509,12 @@
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <NAME><![CDATA[Recalculate Permissions]]></NAME>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <DESCRIPTION><![CDATA[Recalculate Permissions]]></DESCRIPTION>
-<!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <HELP><![CDATA[This process recalculates role permissions, based on the role inheritance defined. Depending on the role type the behavior varies:
-- If the role is a template one, the permissions for the role will be recalculated and also propagated to every role which is currently inheriting from this template.
-- If the role is not marked as template, just the permissions for this role are recalculated.
-For details - http://wiki.openbravo.com/wiki/Role#Permissions_Inheritance]]></HELP>
+<!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <HELP><![CDATA[A process which recalculates role permissions using role inheritance]]></HELP>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <AD_TAB_ID><![CDATA[119]]></AD_TAB_ID>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <AD_COLUMN_ID><![CDATA[BD52841FB8554ED8B347EDDD9A48D00E]]></AD_COLUMN_ID>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--E63ED96DC2FB41A2ADD1F6C5B5C08319-->  <SEQNO><![CDATA[160]]></SEQNO>
--- a/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -6,7 +6,7 @@
 <!--0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0-->  <NAME><![CDATA[Core]]></NAME>
-<!--0-->  <VERSION><![CDATA[3.0.28860]]></VERSION>
+<!--0-->  <VERSION><![CDATA[3.0.28838]]></VERSION>
 <!--0-->  <DESCRIPTION><![CDATA[Core module is the base one]]></DESCRIPTION>
 <!--0-->  <HELP><![CDATA[Core module is the base one, all developments in core are included as part of the standard Openbravo ERP.]]></HELP>
 <!--0-->  <URL><![CDATA[www.openbravo.com]]></URL>
@@ -22,7 +22,7 @@
 <!--0-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--0-->  <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
 <!--0-->  <REFERENCEDATAINFO><![CDATA[Standard document types for orders, invoices, etc. and settings]]></REFERENCEDATAINFO>
-<!--0-->  <VERSION_LABEL><![CDATA[PR16Q2]]></VERSION_LABEL>
+<!--0-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--0-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--0-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--0--></AD_MODULE>
--- a/src-db/database/sourcedata/AD_TAB.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/sourcedata/AD_TAB.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -15848,8 +15848,6 @@
 <!--652123A308954FE8AA072DE90EE7C988-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--652123A308954FE8AA072DE90EE7C988-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--652123A308954FE8AA072DE90EE7C988-->  <NAME><![CDATA[Related Services]]></NAME>
-<!--652123A308954FE8AA072DE90EE7C988-->  <DESCRIPTION><![CDATA[In this table the 'Service' type product Order Lines related to an Order Line are displayed]]></DESCRIPTION>
-<!--652123A308954FE8AA072DE90EE7C988-->  <HELP><![CDATA[In this table the 'Service' type product Order Lines related to an Order Line are displayed]]></HELP>
 <!--652123A308954FE8AA072DE90EE7C988-->  <AD_TABLE_ID><![CDATA[15EAF61631484A11B6921AB05A342E8B]]></AD_TABLE_ID>
 <!--652123A308954FE8AA072DE90EE7C988-->  <AD_WINDOW_ID><![CDATA[143]]></AD_WINDOW_ID>
 <!--652123A308954FE8AA072DE90EE7C988-->  <SEQNO><![CDATA[29]]></SEQNO>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -9159,8 +9159,6 @@
 <!--15EAF61631484A11B6921AB05A342E8B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--15EAF61631484A11B6921AB05A342E8B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--15EAF61631484A11B6921AB05A342E8B-->  <NAME><![CDATA[C_Orderline_Productrelation]]></NAME>
-<!--15EAF61631484A11B6921AB05A342E8B-->  <DESCRIPTION><![CDATA[In this table the 'Service' type product Order Lines related to an Order Line are displayed]]></DESCRIPTION>
-<!--15EAF61631484A11B6921AB05A342E8B-->  <HELP><![CDATA[In this table the 'Service' type product Order Lines related to an Order Line are displayed]]></HELP>
 <!--15EAF61631484A11B6921AB05A342E8B-->  <TABLENAME><![CDATA[C_Orderline_Productrelation]]></TABLENAME>
 <!--15EAF61631484A11B6921AB05A342E8B-->  <ISVIEW><![CDATA[N]]></ISVIEW>
 <!--15EAF61631484A11B6921AB05A342E8B-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
--- a/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Thu Jun 16 05:35:45 2016 +0000
@@ -613,8 +613,7 @@
 <!--F1EC1AB61DCD4858BAD3A52BE60006F9-->  <NAME><![CDATA[Recalculate Role Permissions]]></NAME>
 <!--F1EC1AB61DCD4858BAD3A52BE60006F9-->  <HELP><![CDATA[This process recalculates role permissions, based on the role inheritance defined. Depending on the role type the behavior varies:
 - If the role is a template one, the permissions for the role will be recalculated and also propagated to every role which is currently inheriting from this template.
-- If the role is not marked as template, just the permissions for this role are recalculated.
-For details - http://wiki.openbravo.com/wiki/Role#Permissions_Inheritance]]></HELP>
+- If the role is not marked as template, just the permissions for this role are recalculated. ]]></HELP>
 <!--F1EC1AB61DCD4858BAD3A52BE60006F9-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
 <!--F1EC1AB61DCD4858BAD3A52BE60006F9-->  <CLASSNAME><![CDATA[OB.RoleInheritance.recalculatePermissions]]></CLASSNAME>
 <!--F1EC1AB61DCD4858BAD3A52BE60006F9-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
--- a/src-test/src/org/openbravo/test/services/ServicesTest.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src-test/src/org/openbravo/test/services/ServicesTest.java	Thu Jun 16 05:35:45 2016 +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 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -222,7 +222,6 @@
       OBDal.getInstance().remove(orls);
       OBDal.getInstance().flush();
     }
-    olsrScroller.close();
   }
 
   private void updateServiceRelationAmounts(OrderLine serviceOrderLine, BigDecimal amount,
@@ -243,7 +242,6 @@
       OBDal.getInstance().save(orls);
       OBDal.getInstance().flush();
     }
-    olsrScroller.close();
   }
 
   private OrderLine insertLine(Order sampleOrder, Order testOrder, String productId,
--- a/src/org/openbravo/base/secureApp/Attribute_data.xsql	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/base/secureApp/Attribute_data.xsql	Thu Jun 16 05:35:45 2016 +0000
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!--
  ************************************************************************************
- * Copyright (C) 2001-2016 Openbravo S.L.U.
+ * Copyright (C) 2001-2011 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -29,21 +29,6 @@
       <Parameter name="clientlist" optional="true" type="replace" after="AND a.AD_CLIENT_ID IN (" text="'1'"/>
       <Parameter name="orglist" optional="true" type="replace" after="AND a.AD_ORG_ID IN (" text="'1'"/>
    </SqlMethod>
-   <SqlMethod name="selectAcctSchema" type="preparedStatement" return="multiple">
-      <SqlMethodComment></SqlMethodComment>
-      <Sql><![CDATA[
-        SELECT a.C_ACCTSCHEMA_ID as VALUE, a.C_CURRENCY_ID as Attribute, a.HASALIAS,
-        ae.ELEMENTTYPE, '' as AD_Window_ID, '' as C_CURRENCY_ID
-        FROM C_AcctSchema a
-        JOIN C_AcctSchema_Element ae
-        ON a.C_AcctSchema_ID=ae.C_ACCTSCHEMA_ID
-        WHERE a.C_AcctSchema_ID = ?
-        AND a.AD_CLIENT_ID IN ('1')
-        AND ae.ISACTIVE = 'Y'
-      ]]></Sql>
-      <Parameter name="acctId"/>
-      <Parameter name="clientlist" optional="true" type="replace" after="AND a.AD_CLIENT_ID IN (" text="'1'"/>
-   </SqlMethod>
    <SqlMethod name="selectIsSOTrx" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
--- a/src/org/openbravo/base/secureApp/LoginUtils.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/base/secureApp/LoginUtils.java	Thu Jun 16 05:35:45 2016 +0000
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2016 Openbravo S.L.U.
+ * Copyright (C) 2001-2014 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -21,8 +21,6 @@
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.openbravo.base.HttpBaseUtils;
 import org.openbravo.base.exception.OBException;
@@ -34,7 +32,6 @@
 import org.openbravo.erpCommon.businessUtility.Preferences;
 import org.openbravo.erpCommon.security.SessionLogin;
 import org.openbravo.erpCommon.utility.DimensionDisplayUtility;
-import org.openbravo.erpCommon.utility.OBLedgerUtils;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.access.RoleOrganization;
 import org.openbravo.model.ad.domain.Preference;
@@ -260,19 +257,9 @@
       vars.setSessionValue("#Client_SMTP", data[0].smtphost);
       data = null;
 
-      AttributeData[] attr = null;
-      String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler").split(",");
-      for (String orgId : orgList) {
-        String acctSchemaId = OBLedgerUtils.getOrgLedger(orgId.replace("'", ""));
-        if (StringUtils.isNotEmpty(acctSchemaId)) {
-          attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
-              Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
-          if (ArrayUtils.isNotEmpty(attr)) {
-            break;
-          }
-        }
-      }
-
+      AttributeData[] attr = AttributeData.select(conn,
+          Utility.getContext(conn, vars, "#User_Client", "LoginHandler"),
+          Utility.getContext(conn, vars, "#User_Org", "LoginHandler"));
       if (attr != null && attr.length > 0) {
         vars.setSessionValue("$C_AcctSchema_ID", attr[0].value);
         if (orgCurrency.length > 0) {
--- a/src/org/openbravo/common/actionhandler/ServiceOrderLineRelate.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/common/actionhandler/ServiceOrderLineRelate.java	Thu Jun 16 05:35:45 2016 +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 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -57,7 +57,6 @@
     JSONObject jsonRequest = null;
     OBContext.setAdminMode(true);
     JSONObject errorMessage = new JSONObject();
-    ScrollableResults scroller = null;
     try {
       jsonRequest = new JSONObject(content);
       log.debug("{}", jsonRequest);
@@ -108,7 +107,7 @@
       rol.setNamedParameter("orderLineId", mainOrderLine.getId());
       rol.setMaxResult(1000);
 
-      scroller = rol.scroll(ScrollMode.FORWARD_ONLY);
+      final ScrollableResults scroller = rol.scroll(ScrollMode.FORWARD_ONLY);
       while (scroller.next()) {
         final OrderlineServiceRelation or = (OrderlineServiceRelation) scroller.get()[0];
         OBDal.getInstance().remove(or);
@@ -321,9 +320,6 @@
         log.error(e.getMessage(), e2);
       }
     } finally {
-      if (scroller != null) {
-        scroller.close();
-      }
       OBContext.restorePreviousMode();
     }
     return jsonRequest;
--- a/src/org/openbravo/erpCommon/ad_reports/ReportValuationStock.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportValuationStock.java	Thu Jun 16 05:35:45 2016 +0000
@@ -127,11 +127,10 @@
               Utility.messageBD(this, "WarehouseNotInLE", vars.getLanguage()), "");
         } else {
           try {
-            // Use a static date time format to ensure we have the same pattern for java and sql
             CostingRule costingRule = CostingUtils.getCostDimensionRule(legalEntity,
                 OBDateUtils.getDate(strDate));
-            strDateFrom = OBDateUtils.formatDate(
-                CostingUtils.getCostingRuleStartingDate(costingRule), "dd-MM-yyyy HH:mm:ss");
+            strDateFrom = OBDateUtils.formatDateTime(CostingUtils
+                .getCostingRuleStartingDate(costingRule));
           } catch (Exception exception) {
             advise(
                 request,
@@ -143,8 +142,8 @@
         }
         data = ReportValuationStockData.select(this, vars.getLanguage(), strCurrencyId,
             (legalEntity == null) ? null : legalEntity.getId(),
-            DateTimeData.nDaysAfter(this, strDate, "1"), strDateFrom, "DD-MM-YYYY HH24:MI:SS",
-            strWarehouse, strCategoryProduct);
+            DateTimeData.nDaysAfter(this, strDate, "1"), strDateFrom, strWarehouse,
+            strCategoryProduct);
         boolean hasTrxWithNoCost = hasTrxWithNoCost(strDate, strWarehouse, strCategoryProduct);
         if (hasTrxWithNoCost) {
           OBError warning = new OBError();
--- a/src/org/openbravo/erpCommon/ad_reports/ReportValuationStock_data.xsql	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportValuationStock_data.xsql	Thu Jun 16 05:35:45 2016 +0000
@@ -12,7 +12,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) 2001-2016 Openbravo SLU
+ * All portions are Copyright (C) 2001-2015 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -51,7 +51,7 @@
                                 WHERE COALESCE(DATEACCT, COSTDATE) < to_date(?)
                                 GROUP BY m_transaction_id, C_CURRENCY_ID, COALESCE(DATEACCT, COSTDATE)) TC ON TRX.M_TRANSACTION_ID = TC.M_TRANSACTION_ID
                  WHERE TRX.MOVEMENTDATE < to_date(?)
-                 AND TRX.TRXPROCESSDATE >= to_timestamp(?, ?)
+                 AND TRX.TRXPROCESSDATE > to_date(?)
                  AND L.M_WAREHOUSE_ID = ?
                  GROUP BY TRX.M_TRANSACTION_ID, TRX.M_PRODUCT_ID, TRX.C_UOM_ID, TRX.AD_CLIENT_ID, TRX.ISCOSTCALCULATED, TC.C_CURRENCY_ID, TC.MOVEMENTDATE) A ON TR.M_TRANSACTION_ID = A.M_TRANSACTION_ID,
                 C_UOM,
@@ -74,7 +74,6 @@
       <Parameter name="datePlus"/>
       <Parameter name="datePlus"/>
       <Parameter name="dateFrom"/>
-      <Parameter name="dateTimeFormat"/>
       <Parameter name="warehouse"/>
       <Parameter name="categoryProduct" optional="true" after="AND   1 = 1"><![CDATA[ AND M_PRODUCT.M_PRODUCT_CATEGORY_ID= ? ]]></Parameter>
   </SqlMethod>
--- a/src/org/openbravo/erpCommon/info/ServiceProductPricePrecisionFilterExpression.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/erpCommon/info/ServiceProductPricePrecisionFilterExpression.java	Thu Jun 16 05:35:45 2016 +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 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -41,6 +41,7 @@
           context.getString("inpcOrderlineId"));
       return orderLine.getSalesOrder().getCurrency().getPricePrecision().toString();
     } catch (JSONException e) {
+      // TODO Auto-generated catch block
       log.error("Error trying to get default value of " + strCurrentParam + " " + e.getMessage(), e);
       return null;
     }
--- a/src/org/openbravo/erpCommon/obps/ActivationKey.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/erpCommon/obps/ActivationKey.java	Thu Jun 16 05:35:45 2016 +0000
@@ -839,7 +839,7 @@
   public ActivationMsg getActivationMessage() {
     if (StringUtils.isNotEmpty(errorMessage)) {
       // there is a core message (expiration, etc.), return it
-      return new ActivationMsg(MsgSeverity.forType(messageType), errorMessage);
+      return new ActivationMsg(MsgSeverity.valueOf(messageType), errorMessage);
     }
 
     // look for messages defined by modules
--- a/src/org/openbravo/erpCommon/obps/ModuleLicenseRestrictions.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/erpCommon/obps/ModuleLicenseRestrictions.java	Thu Jun 16 05:35:45 2016 +0000
@@ -58,9 +58,9 @@
       this.type = type;
     }
 
-    static MsgSeverity forType(String typeToCheck) {
+    MsgSeverity forType(String typeToCheck) {
       for (MsgSeverity severity : MsgSeverity.values()) {
-        if (severity.type.equals(typeToCheck)) {
+        if (typeToCheck.equals(severity.toString())) {
           return severity;
         }
       }
--- a/src/org/openbravo/erpCommon/utility/OBLedgerUtils.java	Fri Jun 10 09:50:42 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +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) 2016 Openbravo SLU
- * All Rights Reserved.
- * Contributor(s):  ______________________________________.
- ************************************************************************
- */
-package org.openbravo.erpCommon.utility;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
-import org.hibernate.Query;
-import org.openbravo.dal.core.OBContext;
-import org.openbravo.dal.service.OBDal;
-import org.openbravo.model.common.enterprise.Organization;
-import org.openbravo.model.financialmgmt.accounting.coa.AcctSchema;
-
-/**
- * Utilities to get AcctSchema
- */
-public class OBLedgerUtils {
-  private static Logger log4j = Logger.getLogger(OBLedgerUtils.class);
-
-  /**
-   * Returns the ledger id for the given organization id.
-   * 
-   * If the org id is empty, it returns null. If the given organization has no ledger, it tries to
-   * get its legal entity's ledger. If not found, it returns the organization client's ledger
-   * 
-   * @param orgId
-   *          Organization Id whose ledger is needed
-   * 
-   * @return String ledgerId ledger id for the given organization. Null if not found
-   */
-  public static String getOrgLedger(String orgId) {
-    try {
-      OBContext.setAdminMode(true);
-
-      if (StringUtils.isBlank(orgId)) {
-        // No organization
-        return null;
-      }
-      final Organization org = OBDal.getInstance().get(Organization.class, orgId);
-      if (org == null) {
-        // No organization
-        return null;
-      }
-      String acctSchemaId = getOrgLedgerRecursive(orgId);
-      if (!StringUtils.isEmpty(acctSchemaId)) {
-        // Get ledger of organization tree
-        return acctSchemaId;
-      }
-      String clientId = StringUtils.equals(orgId, "0") ? OBContext.getOBContext()
-          .getCurrentClient().getId() : org.getClient().getId();
-      // Get client base Ledger
-      return getClientLedger(clientId);
-
-    } catch (Exception e) {
-      log4j.error("Impossible to get ledger for organization id " + orgId, e);
-    } finally {
-      OBContext.restorePreviousMode();
-    }
-
-    return null;
-  }
-
-  private static String getOrgLedgerRecursive(String orgId) {
-    try {
-      OBContext.setAdminMode(true);
-      StringBuffer where = new StringBuffer();
-      where.append(" select " + Organization.PROPERTY_GENERALLEDGER + ".id");
-      where.append(" from " + Organization.ENTITY_NAME);
-      where.append(" where ad_isorgincluded(:orgId, " + Organization.PROPERTY_ID + ", "
-          + Organization.PROPERTY_CLIENT + ".id) <> -1");
-      where.append(" and " + Organization.PROPERTY_GENERALLEDGER + " is not null");
-      where.append(" order by ad_isorgincluded(:orgId, " + Organization.PROPERTY_ID + ", "
-          + Organization.PROPERTY_CLIENT + ".id)");
-      Query qry = OBDal.getInstance().getSession().createQuery(where.toString());
-      qry.setParameter("orgId", orgId);
-      qry.setMaxResults(1);
-      return (String) qry.uniqueResult();
-    } finally {
-      OBContext.restorePreviousMode();
-    }
-  }
-
-  private static String getClientLedger(String clientId) {
-    try {
-      OBContext.setAdminMode(true);
-      StringBuffer where = new StringBuffer();
-      where.append(" select " + AcctSchema.PROPERTY_ID);
-      where.append(" from " + AcctSchema.ENTITY_NAME);
-      where.append(" where " + AcctSchema.PROPERTY_CLIENT + ".id = :clientId");
-      where.append(" order by " + AcctSchema.PROPERTY_NAME);
-      Query qry = OBDal.getInstance().getSession().createQuery(where.toString());
-      qry.setParameter("clientId", clientId);
-      qry.setMaxResults(1);
-      return (String) qry.uniqueResult();
-    } finally {
-      OBContext.restorePreviousMode();
-    }
-  }
-}
--- a/src/org/openbravo/event/ServiceOrderLineEventHandler.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/event/ServiceOrderLineEventHandler.java	Thu Jun 16 05:35:45 2016 +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 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -25,7 +25,6 @@
 import org.apache.log4j.Logger;
 import org.hibernate.ScrollMode;
 import org.hibernate.ScrollableResults;
-import org.openbravo.base.exception.OBException;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
@@ -92,57 +91,49 @@
         OBQuery<OrderlineServiceRelation> rol = relatedServices(thisLine);
         rol.setMaxResult(1000);
         final ScrollableResults scroller = rol.scroll(ScrollMode.FORWARD_ONLY);
-        try {
-          while (scroller.next()) {
-            boolean changed = false;
-            final OrderlineServiceRelation or = (OrderlineServiceRelation) scroller.get()[0];
-            // Order Quantity has changed from positive to negative or backwards
-            if (currentOrderedQty.signum() != 0 && oldOrderedQty.signum() != 0
-                && currentOrderedQty.signum() != oldOrderedQty.signum()) {
-              // Create new order line
-              if (lineNo == null) {
-                lineNo = ServicePriceUtils.getNewLineNo(thisLine.getSalesOrder().getId());
-              } else {
-                lineNo = lineNo + 10L;
-              }
-              OrderLine secondOrderline = (OrderLine) DalUtil.copy(or.getSalesOrderLine(), false);
-              secondOrderline.setLineNo(lineNo);
-              secondOrderline.setId(SequenceIdData.getUUID());
-              secondOrderline.setNewOBObject(true);
-              OBDal.getInstance().save(secondOrderline);
+        while (scroller.next()) {
+          boolean changed = false;
+          final OrderlineServiceRelation or = (OrderlineServiceRelation) scroller.get()[0];
+          // Order Quantity has changed from positive to negative or backwards
+          if (currentOrderedQty.signum() != 0 && oldOrderedQty.signum() != 0
+              && currentOrderedQty.signum() != oldOrderedQty.signum()) {
+            // Create new order line
+            if (lineNo == null) {
+              lineNo = ServicePriceUtils.getNewLineNo(thisLine.getSalesOrder().getId());
+            } else {
+              lineNo = lineNo + 10L;
+            }
+            OrderLine secondOrderline = (OrderLine) DalUtil.copy(or.getSalesOrderLine(), false);
+            secondOrderline.setLineNo(lineNo);
+            secondOrderline.setId(SequenceIdData.getUUID());
+            secondOrderline.setNewOBObject(true);
+            OBDal.getInstance().save(secondOrderline);
 
-              // Delete relation line
-              OBDal.getInstance().remove(or);
+            // Delete relation line
+            OBDal.getInstance().remove(or);
 
-              // Create new relation line and relate to the new orderline
-              OrderlineServiceRelation olsr = OBProvider.getInstance().get(
-                  OrderlineServiceRelation.class);
-              olsr.setClient(thisLine.getClient());
-              olsr.setOrganization(thisLine.getOrganization());
-              olsr.setOrderlineRelated(thisLine);
-              olsr.setSalesOrderLine(secondOrderline);
-              olsr.setAmount(currentAmount);
-              olsr.setQuantity(currentOrderedQty);
-              OBDal.getInstance().save(olsr);
-            } else {
-              if (or.getQuantity().compareTo(currentOrderedQty) != 0) {
-                or.setQuantity(currentOrderedQty);
-                changed = true;
-              }
-              if (currentAmount.compareTo(oldAmount) != 0) {
-                or.setAmount(currentAmount);
-                changed = true;
-              }
-              if (changed) {
-                OBDal.getInstance().save(or);
-              }
+            // Create new relation line and relate to the new orderline
+            OrderlineServiceRelation olsr = OBProvider.getInstance().get(
+                OrderlineServiceRelation.class);
+            olsr.setClient(thisLine.getClient());
+            olsr.setOrganization(thisLine.getOrganization());
+            olsr.setOrderlineRelated(thisLine);
+            olsr.setSalesOrderLine(secondOrderline);
+            olsr.setAmount(currentAmount);
+            olsr.setQuantity(currentOrderedQty);
+            OBDal.getInstance().save(olsr);
+          } else {
+            if (or.getQuantity().compareTo(currentOrderedQty) != 0) {
+              or.setQuantity(currentOrderedQty);
+              changed = true;
             }
-          }
-        } catch (Exception e) {
-          throw new OBException("Error in SalesOrderLineEventHandler" + e.getMessage());
-        } finally {
-          if (scroller != null) {
-            scroller.close();
+            if (currentAmount.compareTo(oldAmount) != 0) {
+              or.setAmount(currentAmount);
+              changed = true;
+            }
+            if (changed) {
+              OBDal.getInstance().save(or);
+            }
           }
         }
       }
--- a/src/org/openbravo/materialmgmt/ServicePriceUtils.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/materialmgmt/ServicePriceUtils.java	Thu Jun 16 05:35:45 2016 +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 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -68,91 +68,86 @@
       BigDecimal totalDiscounts, BigDecimal totalPrice, BigDecimal relatedQty,
       BigDecimal unitDiscountsAmt) {
     final Product serviceProduct = orderline.getProduct();
-    OBContext.setAdminMode(true);
-    try {
-      if (linesTotalAmount != null && linesTotalAmount.compareTo(BigDecimal.ZERO) == 0) {
-        return BigDecimal.ZERO;
-      }
-      BigDecimal serviceBasePrice = getProductPrice(orderline.getOrderDate(), orderline
-          .getSalesOrder().getPriceList(), serviceProduct);
-      if (serviceBasePrice == null) {
-        throw new OBException("@ServiceProductPriceListVersionNotFound@ "
-            + serviceProduct.getIdentifier() + ", @Date@: "
+    if (linesTotalAmount != null && linesTotalAmount.compareTo(BigDecimal.ZERO) == 0) {
+      return BigDecimal.ZERO;
+    }
+    BigDecimal serviceBasePrice = getProductPrice(orderline.getOrderDate(), orderline
+        .getSalesOrder().getPriceList(), serviceProduct);
+    if (serviceBasePrice == null) {
+      throw new OBException("@ServiceProductPriceListVersionNotFound@ "
+          + serviceProduct.getIdentifier() + ", @Date@: "
+          + OBDateUtils.formatDate(orderline.getOrderDate()));
+    }
+    BigDecimal serviceRelatedPrice = BigDecimal.ZERO;
+    boolean isPriceRuleBased = serviceProduct.isPricerulebased();
+    if (!isPriceRuleBased) {
+      return BigDecimal.ZERO;
+    } else {
+      ServicePriceRule servicePriceRule = getServicePriceRule(serviceProduct,
+          orderline.getOrderDate());
+      if (servicePriceRule == null) {
+        throw new OBException("@ServicePriceRuleVersionNotFound@ "
+            + orderline.getProduct().getIdentifier() + ", @Date@: "
             + OBDateUtils.formatDate(orderline.getOrderDate()));
       }
-      BigDecimal serviceRelatedPrice = BigDecimal.ZERO;
-      boolean isPriceRuleBased = serviceProduct.isPricerulebased();
-      if (!isPriceRuleBased) {
-        return BigDecimal.ZERO;
+      BigDecimal relatedAmount = BigDecimal.ZERO;
+      BigDecimal findRangeAmount = BigDecimal.ZERO;
+      if (linesTotalAmount != null) {
+        relatedAmount = linesTotalAmount;
       } else {
-        ServicePriceRule servicePriceRule = getServicePriceRule(serviceProduct,
-            orderline.getOrderDate());
-        if (servicePriceRule == null) {
-          throw new OBException("@ServicePriceRuleVersionNotFound@ "
-              + orderline.getProduct().getIdentifier() + ", @Date@: "
-              + OBDateUtils.formatDate(orderline.getOrderDate()));
+        HashMap<String, BigDecimal> relatedAmountAndQuatity = getRelatedAmountAndQty(orderline);
+        relatedAmount = relatedAmountAndQuatity.get("amount");
+        // TODO: APPLY quantities
+        relatedQty = relatedAmountAndQuatity.get("quantity");
+      }
+
+      if (PERCENTAGE.equals(servicePriceRule.getRuletype())) {
+        if (!servicePriceRule.isAfterdiscounts() && totalDiscounts != null
+            && unitDiscountsAmt != null) {
+          relatedAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? relatedAmount
+              .add(totalDiscounts) : relatedAmount.add(unitDiscountsAmt);
         }
-        BigDecimal relatedAmount = BigDecimal.ZERO;
-        BigDecimal findRangeAmount = BigDecimal.ZERO;
-        if (linesTotalAmount != null) {
-          relatedAmount = linesTotalAmount;
+        serviceRelatedPrice = relatedAmount.multiply(new BigDecimal(servicePriceRule
+            .getPercentage()).divide(new BigDecimal("100.00")));
+      } else {
+        if (!servicePriceRule.isAfterdiscounts() && totalDiscounts != null
+            && unitDiscountsAmt != null) {
+          findRangeAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
+              .add(totalDiscounts) : totalPrice.add(unitDiscountsAmt);
         } else {
-          HashMap<String, BigDecimal> relatedAmountAndQuatity = getRelatedAmountAndQty(orderline);
-          relatedAmount = relatedAmountAndQuatity.get("amount");
-          // TODO: APPLY quantities
-          relatedQty = relatedAmountAndQuatity.get("quantity");
+          findRangeAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
+              : totalPrice;
         }
-
-        if (PERCENTAGE.equals(servicePriceRule.getRuletype())) {
-          if (!servicePriceRule.isAfterdiscounts() && totalDiscounts != null
-              && unitDiscountsAmt != null) {
-            relatedAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? relatedAmount
-                .add(totalDiscounts) : relatedAmount.add(unitDiscountsAmt);
-          }
-          serviceRelatedPrice = relatedAmount.multiply(new BigDecimal(servicePriceRule
-              .getPercentage()).divide(new BigDecimal("100.00")));
-        } else {
-          if (!servicePriceRule.isAfterdiscounts() && totalDiscounts != null
-              && unitDiscountsAmt != null) {
-            findRangeAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
+        ServicePriceRuleRange range = getRange(servicePriceRule, findRangeAmount);
+        if (range == null) {
+          throw new OBException("@ServicePriceRuleRangeNotFound@. @ServicePriceRule@: "
+              + servicePriceRule.getIdentifier() + ", @AmountUpTo@: " + linesTotalAmount);
+        }
+        if (PERCENTAGE.equals(range.getRuleType())) {
+          if (!range.isAfterDiscounts() && totalDiscounts != null && unitDiscountsAmt != null) {
+            relatedAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
                 .add(totalDiscounts) : totalPrice.add(unitDiscountsAmt);
           } else {
-            findRangeAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
+            relatedAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
                 : totalPrice;
           }
-          ServicePriceRuleRange range = getRange(servicePriceRule, findRangeAmount);
-          if (range == null) {
-            throw new OBException("@ServicePriceRuleRangeNotFound@. @ServicePriceRule@: "
-                + servicePriceRule.getIdentifier() + ", @AmountUpTo@: " + linesTotalAmount);
-          }
-          if (PERCENTAGE.equals(range.getRuleType())) {
-            if (!range.isAfterDiscounts() && totalDiscounts != null && unitDiscountsAmt != null) {
-              relatedAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
-                  .add(totalDiscounts) : totalPrice.add(unitDiscountsAmt);
-            } else {
-              relatedAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
-                  : totalPrice;
-            }
-            serviceRelatedPrice = relatedAmount.multiply(new BigDecimal(range.getPercentage())
-                .divide(new BigDecimal("100.00")));
-          } else {
-            serviceRelatedPrice = getProductPrice(orderline.getOrderDate(), range.getPriceList(),
-                serviceProduct);
-            if (serviceRelatedPrice == null) {
-              throw new OBException("@ServiceProductPriceListVersionNotFound@ "
-                  + serviceProduct.getIdentifier() + ", @Date@: "
-                  + OBDateUtils.formatDate(orderline.getOrderDate()));
-            }
-          }
-          if (!UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule())) {
-            serviceRelatedPrice = serviceRelatedPrice.multiply(relatedQty);
+          serviceRelatedPrice = relatedAmount.multiply(new BigDecimal(range.getPercentage())
+              .divide(new BigDecimal("100.00")));
+        } else {
+          serviceRelatedPrice = getProductPrice(orderline.getOrderDate(), range.getPriceList(),
+              serviceProduct);
+          if (serviceRelatedPrice == null) {
+            throw new OBException("@ServiceProductPriceListVersionNotFound@ "
+                + serviceProduct.getIdentifier() + ", @Date@: "
+                + OBDateUtils.formatDate(orderline.getOrderDate()));
           }
         }
-        return serviceRelatedPrice.setScale(orderline.getCurrency().getPricePrecision().intValue(),
-            RoundingMode.HALF_UP);
+        if (!UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule())) {
+          serviceRelatedPrice = serviceRelatedPrice.multiply(relatedQty);
+        }
       }
-    } finally {
-      OBContext.restorePreviousMode();
+      return serviceRelatedPrice.setScale(orderline.getCurrency().getPricePrecision().intValue(),
+          RoundingMode.HALF_UP);
     }
   }
 
@@ -167,56 +162,40 @@
    */
   private static ServicePriceRuleRange getRange(ServicePriceRule servicePriceRule,
       BigDecimal relatedAmount) {
-    OBContext.setAdminMode(true);
-    try {
-      StringBuffer where = new StringBuffer();
-      where.append("  as sprr");
-      where.append(" where " + ServicePriceRuleRange.PROPERTY_SERVICEPRICERULE
-          + ".id = :servicePriceRuleId");
-      where.append(" and (" + ServicePriceRuleRange.PROPERTY_AMOUNTUPTO + " >= :amount or "
-          + ServicePriceRuleRange.PROPERTY_AMOUNTUPTO + " is null)");
-      where.append(" order by " + ServicePriceRuleRange.PROPERTY_AMOUNTUPTO + ", "
-          + ServicePriceRuleVersion.PROPERTY_CREATIONDATE + " desc");
-      OBQuery<ServicePriceRuleRange> sprrQry = OBDal.getInstance().createQuery(
-          ServicePriceRuleRange.class, where.toString());
-      sprrQry.setNamedParameter("servicePriceRuleId", servicePriceRule.getId());
-      sprrQry.setNamedParameter("amount", relatedAmount);
-      sprrQry.setMaxResult(1);
-      return sprrQry.uniqueResult();
-    } finally {
-      OBContext.restorePreviousMode();
-    }
+    StringBuffer where = new StringBuffer();
+    where.append("  as sprr");
+    where.append(" where " + ServicePriceRuleRange.PROPERTY_SERVICEPRICERULE
+        + ".id = :servicePriceRuleId");
+    where.append(" and (" + ServicePriceRuleRange.PROPERTY_AMOUNTUPTO + " >= :amount or "
+        + ServicePriceRuleRange.PROPERTY_AMOUNTUPTO + " is null)");
+    where.append(" order by " + ServicePriceRuleRange.PROPERTY_AMOUNTUPTO + ", "
+        + ServicePriceRuleVersion.PROPERTY_CREATIONDATE + " desc");
+    OBQuery<ServicePriceRuleRange> sprrQry = OBDal.getInstance().createQuery(
+        ServicePriceRuleRange.class, where.toString());
+    sprrQry.setNamedParameter("servicePriceRuleId", servicePriceRule.getId());
+    sprrQry.setNamedParameter("amount", relatedAmount);
+    sprrQry.setMaxResult(1);
+    return sprrQry.uniqueResult();
   }
 
-  /**
-   * Method that returns the total amount, quantity and price of all lines related to the given line
-   * 
-   * @param orderLine
-   * @return
-   */
   public static HashMap<String, BigDecimal> getRelatedAmountAndQty(OrderLine orderLine) {
-    OBContext.setAdminMode(true);
-    try {
-      StringBuffer strQuery = new StringBuffer();
-      strQuery
-          .append("select coalesce(sum(e.amount),0), coalesce(sum(e.quantity),0), coalesce(sum(case when pl.priceIncludesTax = false then ol.unitPrice else ol.grossUnitPrice end), 0)");
-      strQuery.append(" from OrderlineServiceRelation as e");
-      strQuery.append(" join e.orderlineRelated as ol");
-      strQuery.append(" join ol.salesOrder as o");
-      strQuery.append(" join o.priceList as pl");
-      strQuery.append(" where e.salesOrderLine.id = :orderLineId");
-      Query query = OBDal.getInstance().getSession().createQuery(strQuery.toString());
-      query.setParameter("orderLineId", orderLine.getId());
-      query.setMaxResults(1);
-      HashMap<String, BigDecimal> result = new HashMap<String, BigDecimal>();
-      Object[] values = (Object[]) query.uniqueResult();
-      result.put("amount", (BigDecimal) values[0]);
-      result.put("quantity", (BigDecimal) values[1]);
-      result.put("price", (BigDecimal) values[2]);
-      return result;
-    } finally {
-      OBContext.restorePreviousMode();
-    }
+    StringBuffer strQuery = new StringBuffer();
+    strQuery
+        .append("select coalesce(sum(e.amount),0), coalesce(sum(e.quantity),0), coalesce(sum(case when pl.priceIncludesTax = false then ol.unitPrice else ol.grossUnitPrice end), 0)");
+    strQuery.append(" from OrderlineServiceRelation as e");
+    strQuery.append(" join e.orderlineRelated as ol");
+    strQuery.append(" join ol.salesOrder as o");
+    strQuery.append(" join o.priceList as pl");
+    strQuery.append(" where e.salesOrderLine.id = :orderLineId");
+    Query query = OBDal.getInstance().getSession().createQuery(strQuery.toString());
+    query.setParameter("orderLineId", orderLine.getId());
+    query.setMaxResults(1);
+    HashMap<String, BigDecimal> result = new HashMap<String, BigDecimal>();
+    Object[] values = (Object[]) query.uniqueResult();
+    result.put("amount", (BigDecimal) values[0]);
+    result.put("quantity", (BigDecimal) values[1]);
+    result.put("price", (BigDecimal) values[2]);
+    return result;
   }
 
   /**
@@ -232,32 +211,28 @@
    */
   public static BigDecimal getProductPrice(Date date, PriceList priceList, Product product)
       throws OBException {
-    OBContext.setAdminMode(true);
-    try {
-      StringBuffer where = new StringBuffer();
-      where.append(" select pp." + ProductPrice.PROPERTY_LISTPRICE + " as listPrice");
-      where.append(" from " + ProductPrice.ENTITY_NAME + " as pp");
-      where.append("   join pp." + ProductPrice.PROPERTY_PRICELISTVERSION + " as plv");
-      where.append("   join plv." + PriceListVersion.PROPERTY_PRICELIST + " as pl");
-      where.append(" where pp." + ProductPrice.PROPERTY_PRODUCT + ".id = :productId");
-      where.append("   and plv." + PriceListVersion.PROPERTY_VALIDFROMDATE + " <= :date");
-      where.append("   and pl.id = :pricelistId");
-      where.append("   and pl." + PriceList.PROPERTY_ACTIVE + " = true");
-      where.append("   and pp." + ProductPrice.PROPERTY_ACTIVE + " = true");
-      where.append("   and plv." + PriceListVersion.PROPERTY_ACTIVE + " = true");
-      where.append(" order by pl." + PriceList.PROPERTY_DEFAULT + " desc, plv."
-          + PriceListVersion.PROPERTY_VALIDFROMDATE + " desc");
 
-      Query ppQry = OBDal.getInstance().getSession().createQuery(where.toString());
-      ppQry.setParameter("productId", product.getId());
-      ppQry.setParameter("date", date);
-      ppQry.setParameter("pricelistId", priceList.getId());
+    StringBuffer where = new StringBuffer();
+    where.append(" select pp." + ProductPrice.PROPERTY_LISTPRICE + " as listPrice");
+    where.append(" from " + ProductPrice.ENTITY_NAME + " as pp");
+    where.append("   join pp." + ProductPrice.PROPERTY_PRICELISTVERSION + " as plv");
+    where.append("   join plv." + PriceListVersion.PROPERTY_PRICELIST + " as pl");
+    where.append(" where pp." + ProductPrice.PROPERTY_PRODUCT + ".id = :productId");
+    where.append("   and plv." + PriceListVersion.PROPERTY_VALIDFROMDATE + " <= :date");
+    where.append("   and pl.id = :pricelistId");
+    where.append("   and pl." + PriceList.PROPERTY_ACTIVE + " = true");
+    where.append("   and pp." + ProductPrice.PROPERTY_ACTIVE + " = true");
+    where.append("   and plv." + PriceListVersion.PROPERTY_ACTIVE + " = true");
+    where.append(" order by pl." + PriceList.PROPERTY_DEFAULT + " desc, plv."
+        + PriceListVersion.PROPERTY_VALIDFROMDATE + " desc");
 
-      ppQry.setMaxResults(1);
-      return (BigDecimal) ppQry.uniqueResult();
-    } finally {
-      OBContext.restorePreviousMode();
-    }
+    Query ppQry = OBDal.getInstance().getSession().createQuery(where.toString());
+    ppQry.setParameter("productId", product.getId());
+    ppQry.setParameter("date", date);
+    ppQry.setParameter("pricelistId", priceList.getId());
+
+    ppQry.setMaxResults(1);
+    return (BigDecimal) ppQry.uniqueResult();
   }
 
   /**
@@ -271,26 +246,21 @@
    * @return
    */
   public static ServicePriceRule getServicePriceRule(Product serviceProduct, Date orderDate) {
-    OBContext.setAdminMode(true);
-    try {
-      StringBuffer where = new StringBuffer();
-      where.append(" select " + ServicePriceRuleVersion.PROPERTY_SERVICEPRICERULE);
-      where.append(" from " + ServicePriceRuleVersion.ENTITY_NAME + " as sprv");
-      where.append(" where sprv." + ServicePriceRuleVersion.PROPERTY_PRODUCT
-          + ".id = :serviceProductId");
-      where
-          .append(" and sprv." + ServicePriceRuleVersion.PROPERTY_VALIDFROMDATE + " <= :orderDate");
-      where.append("   and sprv." + ServicePriceRuleVersion.PROPERTY_ACTIVE + " = true");
-      where.append(" order by sprv." + ServicePriceRuleVersion.PROPERTY_VALIDFROMDATE
-          + " desc, sprv." + ServicePriceRuleVersion.PROPERTY_CREATIONDATE + " desc");
-      Query sprvQry = OBDal.getInstance().getSession().createQuery(where.toString());
-      sprvQry.setParameter("serviceProductId", serviceProduct.getId());
-      sprvQry.setParameter("orderDate", orderDate);
-      sprvQry.setMaxResults(1);
-      return (ServicePriceRule) sprvQry.uniqueResult();
-    } finally {
-      OBContext.restorePreviousMode();
-    }
+
+    StringBuffer where = new StringBuffer();
+    where.append(" select " + ServicePriceRuleVersion.PROPERTY_SERVICEPRICERULE);
+    where.append(" from " + ServicePriceRuleVersion.ENTITY_NAME + " as sprv");
+    where.append(" where sprv." + ServicePriceRuleVersion.PROPERTY_PRODUCT
+        + ".id = :serviceProductId");
+    where.append(" and sprv." + ServicePriceRuleVersion.PROPERTY_VALIDFROMDATE + " <= :orderDate");
+    where.append("   and sprv." + ServicePriceRuleVersion.PROPERTY_ACTIVE + " = true");
+    where.append(" order by sprv." + ServicePriceRuleVersion.PROPERTY_VALIDFROMDATE
+        + " desc, sprv." + ServicePriceRuleVersion.PROPERTY_CREATIONDATE + " desc");
+    Query sprvQry = OBDal.getInstance().getSession().createQuery(where.toString());
+    sprvQry.setParameter("serviceProductId", serviceProduct.getId());
+    sprvQry.setParameter("orderDate", orderDate);
+    sprvQry.setMaxResults(1);
+    return (ServicePriceRule) sprvQry.uniqueResult();
   }
 
   /**
@@ -300,23 +270,17 @@
    *          Order
    */
   public static Long getNewLineNo(String orderId) {
-    OBContext.setAdminMode(true);
-    try {
-      StringBuffer where = new StringBuffer();
-      where.append(" as ol");
-      where.append(" where ol." + OrderLine.PROPERTY_SALESORDER + ".id = :orderId");
-      where.append(" order by ol." + OrderLine.PROPERTY_LINENO + " desc");
-      OBQuery<OrderLine> olQry = OBDal.getInstance().createQuery(OrderLine.class, where.toString());
-      olQry.setNamedParameter("orderId", orderId);
-      olQry.setMaxResult(1);
-      if (olQry.count() > 0) {
-        OrderLine ol = olQry.list().get(0);
-        return ol.getLineNo() + 10L;
-      }
-      return 10L;
-    } finally {
-      OBContext.restorePreviousMode();
+    StringBuffer where = new StringBuffer();
+    where.append(" as ol");
+    where.append(" where ol." + OrderLine.PROPERTY_SALESORDER + ".id = :orderId");
+    where.append(" order by ol." + OrderLine.PROPERTY_LINENO + " desc");
+    OBQuery<OrderLine> olQry = OBDal.getInstance().createQuery(OrderLine.class, where.toString());
+    olQry.setNamedParameter("orderId", orderId);
+    if (olQry.count() > 0) {
+      OrderLine ol = olQry.list().get(0);
+      return ol.getLineNo() + 10L;
     }
+    return 10L;
   }
 
   /**
@@ -333,55 +297,47 @@
   public static JSONObject deferredSaleAllowed(OrderLine orderline, OrderLine orderLineToRelate) {
     JSONObject result = null;
     final Product serviceProduct = orderline.getProduct();
-    OBContext.setAdminMode(true);
-    try {
-      if (orderLineToRelate != null
-          && !orderline.getSalesOrder().getId().equals(orderLineToRelate.getSalesOrder().getId())) {
-        if (!serviceProduct.isAllowDeferredSell()) {
-          throw new OBException("@DeferredSaleNotAllowed@: " + serviceProduct.getIdentifier());
-        } else {
-          try {
-            Date deferredSaleDate = OBDateUtils.getDate(OBDateUtils.formatDate(orderLineToRelate
-                .getSalesOrder().getOrderDate()));
-            Date orderDate = OBDateUtils.getDate(OBDateUtils.formatDate(orderline.getSalesOrder()
-                .getOrderDate()));
-            if (orderline.getProduct().getDeferredSellMaxDays() != null) {
-              deferredSaleDate = DateUtils.addDays(deferredSaleDate, serviceProduct
-                  .getDeferredSellMaxDays().intValue());
-              if (orderDate.after(deferredSaleDate)) {
-                String message = OBMessageUtils.parseTranslation(new DalConnectionProvider(false),
-                    RequestContext.get().getVariablesSecureApp(), OBContext.getOBContext()
-                        .getLanguage().getLanguage(),
-                    "@DeferredSaleExpired@: (" + OBDateUtils.formatDate(deferredSaleDate)
-                        + ") @ForService@ '" + serviceProduct.getIdentifier()
-                        + "' @relatingTo@ @line@ " + orderLineToRelate.getLineNo()
-                        + " @of@ @SalesOrderDocumentno@ "
-                        + orderLineToRelate.getSalesOrder().getDocumentNo());
-                result = new JSONObject();
-                result.put("severity", "warning");
-                result.put("title", "Warning");
-                result.put("text", message);
-              }
+    if (orderLineToRelate != null
+        && !orderline.getSalesOrder().getId().equals(orderLineToRelate.getSalesOrder().getId())) {
+      if (!serviceProduct.isAllowDeferredSell()) {
+        throw new OBException("@DeferredSaleNotAllowed@: " + serviceProduct.getIdentifier());
+      } else {
+        try {
+          Date deferredSaleDate = OBDateUtils.getDate(OBDateUtils.formatDate(orderLineToRelate
+              .getSalesOrder().getOrderDate()));
+          Date orderDate = OBDateUtils.getDate(OBDateUtils.formatDate(orderline.getSalesOrder()
+              .getOrderDate()));
+          if (orderline.getProduct().getDeferredSellMaxDays() != null) {
+            deferredSaleDate = DateUtils.addDays(deferredSaleDate, serviceProduct
+                .getDeferredSellMaxDays().intValue());
+            if (orderDate.after(deferredSaleDate)) {
+              String message = OBMessageUtils.parseTranslation(new DalConnectionProvider(false),
+                  RequestContext.get().getVariablesSecureApp(), OBContext.getOBContext()
+                      .getLanguage().getLanguage(),
+                  "@DeferredSaleExpired@: (" + OBDateUtils.formatDate(deferredSaleDate)
+                      + ") @ForService@ '" + serviceProduct.getIdentifier()
+                      + "' @relatingTo@ @line@ " + orderLineToRelate.getLineNo()
+                      + " @of@ @SalesOrderDocumentno@ "
+                      + orderLineToRelate.getSalesOrder().getDocumentNo());
+              result = new JSONObject();
+              result.put("severity", "warning");
+              result.put("title", "Warning");
+              result.put("text", message);
             }
-          } catch (ParseException e) {
-            // TODO Auto-generated catch block
-            log.error(e.getMessage(), e);
-          } catch (JSONException e) {
-            // TODO Auto-generated catch block
-            log.error(e.getMessage(), e);
           }
+        } catch (ParseException e) {
+          // TODO Auto-generated catch block
+          log.error(e.getMessage(), e);
+        } catch (JSONException e) {
+          // TODO Auto-generated catch block
+          log.error(e.getMessage(), e);
         }
       }
-      return result;
-    } finally {
-      OBContext.restorePreviousMode();
     }
+    return result;
   }
 
   /**
-   * Method that returns a warning message if a service of a Return From Customer is not Returnable
-   * of the return period is expired.
-   * 
    * @param shipmentLine
    * @param serviceProduct
    * @param rfcOrderDate
@@ -390,52 +346,47 @@
   public static JSONObject serviceReturnAllowedRFC(ShipmentInOutLine shipmentLine,
       Product serviceProduct, Date rfcOrderDate) {
     JSONObject result = null;
-    OBContext.setAdminMode(true);
-    try {
-      if (SERVICEPRODUCT.equals(serviceProduct.getProductType())) {
-        if (!serviceProduct.isReturnable()) {
-          throw new OBException("@Service@ '" + serviceProduct.getIdentifier()
-              + "' @ServiceIsNotReturnable@");
-        } else {
-          try {
-            final Date orderDate = shipmentLine != null && shipmentLine.getSalesOrderLine() != null ? OBDateUtils
-                .getDate(OBDateUtils.formatDate(shipmentLine.getSalesOrderLine().getOrderDate()))
-                : null;
-            Date returnDate = null;
-            String message = null;
-            if (orderDate != null && serviceProduct.getOverdueReturnDays() != null) {
-              returnDate = DateUtils.addDays(orderDate, serviceProduct.getOverdueReturnDays()
-                  .intValue());
-            }
-            if (serviceProduct.getOverdueReturnDays() != null && returnDate != null
-                && rfcOrderDate.after(returnDate)) {
-              message = "@Service@ '" + serviceProduct.getIdentifier()
-                  + "' @ServiceReturnExpired@: " + OBDateUtils.formatDate(returnDate);
-            }
-            if (serviceProduct.getOverdueReturnDays() != null && returnDate == null) {
-              message = "@Service@ '" + serviceProduct.getIdentifier()
-                  + "' @ServiceMissingReturnDate@";
-            }
-            if (message != null) {
-              message = OBMessageUtils.parseTranslation(new DalConnectionProvider(false),
-                  RequestContext.get().getVariablesSecureApp(), OBContext.getOBContext()
-                      .getLanguage().getLanguage(), message);
-              result = new JSONObject();
-              result.put("severity", "warning");
-              result.put("title", "Warning");
-              result.put("text", message);
-            }
-          } catch (ParseException e) {
-            log.error(e.getMessage(), e);
-          } catch (JSONException e) {
-            log.error(e.getMessage(), e);
+    if (SERVICEPRODUCT.equals(serviceProduct.getProductType())) {
+      if (!serviceProduct.isReturnable()) {
+        throw new OBException("@Service@ '" + serviceProduct.getIdentifier()
+            + "' @ServiceIsNotReturnable@");
+      } else {
+        try {
+          final Date orderDate = shipmentLine != null && shipmentLine.getSalesOrderLine() != null ? OBDateUtils
+              .getDate(OBDateUtils.formatDate(shipmentLine.getSalesOrderLine().getOrderDate()))
+              : null;
+          Date returnDate = null;
+          String message = null;
+          if (orderDate != null && serviceProduct.getOverdueReturnDays() != null) {
+            returnDate = DateUtils.addDays(orderDate, serviceProduct.getOverdueReturnDays()
+                .intValue());
           }
+          if (serviceProduct.getOverdueReturnDays() != null && returnDate != null
+              && rfcOrderDate.after(returnDate)) {
+            message = "@Service@ '" + serviceProduct.getIdentifier() + "' @ServiceReturnExpired@: "
+                + OBDateUtils.formatDate(returnDate);
+          }
+          if (serviceProduct.getOverdueReturnDays() != null && returnDate == null) {
+            message = "@Service@ '" + serviceProduct.getIdentifier()
+                + "' @ServiceMissingReturnDate@";
+          }
+          if (message != null) {
+            message = OBMessageUtils.parseTranslation(new DalConnectionProvider(false),
+                RequestContext.get().getVariablesSecureApp(), OBContext.getOBContext()
+                    .getLanguage().getLanguage(), message);
+            result = new JSONObject();
+            result.put("severity", "warning");
+            result.put("title", "Warning");
+            result.put("text", message);
+          }
+        } catch (ParseException e) {
+          log.error(e.getMessage(), e);
+        } catch (JSONException e) {
+          log.error(e.getMessage(), e);
         }
       }
-      return result;
-    } finally {
-      OBContext.restorePreviousMode();
     }
+    return result;
   }
 
   /**
@@ -450,69 +401,64 @@
       BigDecimal linesTotalAmount, BigDecimal totalPrice, BigDecimal totalDiscounts,
       BigDecimal unitDiscountsAmt) {
 
-    OBContext.setAdminMode(true);
-    try {
-      final Product serviceProduct = orderline.getProduct();
-      if (linesTotalAmount != null && linesTotalAmount.compareTo(BigDecimal.ZERO) == 0) {
-        return true;
-      }
-      BigDecimal serviceBasePrice = getProductPrice(orderline.getOrderDate(), orderline
-          .getSalesOrder().getPriceList(), serviceProduct);
-      if (serviceBasePrice == null) {
-        throw new OBException("@ServiceProductPriceListVersionNotFound@ "
-            + serviceProduct.getIdentifier() + ", @Date@: "
+    final Product serviceProduct = orderline.getProduct();
+    if (linesTotalAmount != null && linesTotalAmount.compareTo(BigDecimal.ZERO) == 0) {
+      return true;
+    }
+    BigDecimal serviceBasePrice = getProductPrice(orderline.getOrderDate(), orderline
+        .getSalesOrder().getPriceList(), serviceProduct);
+    if (serviceBasePrice == null) {
+      throw new OBException("@ServiceProductPriceListVersionNotFound@ "
+          + serviceProduct.getIdentifier() + ", @Date@: "
+          + OBDateUtils.formatDate(orderline.getOrderDate()));
+    }
+    BigDecimal serviceRelatedPrice = BigDecimal.ZERO;
+    boolean isPriceRuleBased = serviceProduct.isPricerulebased();
+    if (!isPriceRuleBased) {
+      return false;
+    } else {
+      ServicePriceRule servicePriceRule = getServicePriceRule(serviceProduct,
+          orderline.getOrderDate());
+      if (servicePriceRule == null) {
+        throw new OBException("@ServicePriceRuleVersionNotFound@ "
+            + orderline.getProduct().getIdentifier() + ", @Date@: "
             + OBDateUtils.formatDate(orderline.getOrderDate()));
       }
-      BigDecimal serviceRelatedPrice = BigDecimal.ZERO;
-      boolean isPriceRuleBased = serviceProduct.isPricerulebased();
-      if (!isPriceRuleBased) {
-        return false;
+      BigDecimal findRangeAmount = BigDecimal.ZERO;
+
+      if (PERCENTAGE.equals(servicePriceRule.getRuletype())) {
+        if (servicePriceRule.isAfterdiscounts()) {
+          return true;
+        }
       } else {
-        ServicePriceRule servicePriceRule = getServicePriceRule(serviceProduct,
-            orderline.getOrderDate());
-        if (servicePriceRule == null) {
-          throw new OBException("@ServicePriceRuleVersionNotFound@ "
-              + orderline.getProduct().getIdentifier() + ", @Date@: "
-              + OBDateUtils.formatDate(orderline.getOrderDate()));
+        if (!servicePriceRule.isAfterdiscounts() && totalDiscounts != null
+            && unitDiscountsAmt != null) {
+          findRangeAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
+              .add(totalDiscounts) : totalPrice.add(unitDiscountsAmt);
+        } else {
+          findRangeAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
+              : totalPrice;
         }
-        BigDecimal findRangeAmount = BigDecimal.ZERO;
-
-        if (PERCENTAGE.equals(servicePriceRule.getRuletype())) {
+        ServicePriceRuleRange range = getRange(servicePriceRule, findRangeAmount);
+        if (range == null) {
+          throw new OBException("@ServicePriceRuleRangeNotFound@. @ServicePriceRule@: "
+              + servicePriceRule.getIdentifier() + ", @AmountUpTo@: " + linesTotalAmount);
+        }
+        if (PERCENTAGE.equals(range.getRuleType())) {
           if (servicePriceRule.isAfterdiscounts()) {
             return true;
           }
         } else {
-          if (!servicePriceRule.isAfterdiscounts() && totalDiscounts != null
-              && unitDiscountsAmt != null) {
-            findRangeAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
-                .add(totalDiscounts) : totalPrice.add(unitDiscountsAmt);
-          } else {
-            findRangeAmount = UNIQUE_QUANTITY.equals(serviceProduct.getQuantityRule()) ? linesTotalAmount
-                : totalPrice;
-          }
-          ServicePriceRuleRange range = getRange(servicePriceRule, findRangeAmount);
-          if (range == null) {
-            throw new OBException("@ServicePriceRuleRangeNotFound@. @ServicePriceRule@: "
-                + servicePriceRule.getIdentifier() + ", @AmountUpTo@: " + linesTotalAmount);
-          }
-          if (PERCENTAGE.equals(range.getRuleType())) {
-            if (servicePriceRule.isAfterdiscounts()) {
-              return true;
-            }
-          } else {
-            serviceRelatedPrice = getProductPrice(orderline.getOrderDate(), range.getPriceList(),
-                serviceProduct);
-            if (serviceRelatedPrice == null) {
-              throw new OBException("@ServiceProductPriceListVersionNotFound@ "
-                  + serviceProduct.getIdentifier() + ", @Date@: "
-                  + OBDateUtils.formatDate(orderline.getOrderDate()));
-            }
+          serviceRelatedPrice = getProductPrice(orderline.getOrderDate(), range.getPriceList(),
+              serviceProduct);
+          if (serviceRelatedPrice == null) {
+            throw new OBException("@ServiceProductPriceListVersionNotFound@ "
+                + serviceProduct.getIdentifier() + ", @Date@: "
+                + OBDateUtils.formatDate(orderline.getOrderDate()));
           }
         }
-        return false;
       }
-    } finally {
-      OBContext.restorePreviousMode();
+      return false;
     }
   }
 }
--- a/src/org/openbravo/role/inheritance/RoleInheritanceManager.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/role/inheritance/RoleInheritanceManager.java	Thu Jun 16 05:35:45 2016 +0000
@@ -37,7 +37,6 @@
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.base.structure.InheritedAccessEnabled;
 import org.openbravo.dal.core.DalUtil;
-import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.Utility;
@@ -117,17 +116,12 @@
    */
   private void copyRoleAccess(InheritedAccessEnabled parentAccess, Role role,
       AccessTypeInjector injector) {
-    try {
-      OBContext.setAdminMode(false);
-      // copy the new access
-      final InheritedAccessEnabled newAccess = (InheritedAccessEnabled) DalUtil.copy(
-          (BaseOBObject) parentAccess, false);
-      injector.setParent(newAccess, parentAccess, role);
-      newAccess.setInheritedFrom(injector.getRole(parentAccess));
-      OBDal.getInstance().save(newAccess);
-    } finally {
-      OBContext.restorePreviousMode();
-    }
+    // copy the new access
+    final InheritedAccessEnabled newAccess = (InheritedAccessEnabled) DalUtil.copy(
+        (BaseOBObject) parentAccess, false);
+    injector.setParent(newAccess, parentAccess, role);
+    newAccess.setInheritedFrom(injector.getRole(parentAccess));
+    OBDal.getInstance().save(newAccess);
   }
 
   void removeReferenceInParentList(InheritedAccessEnabled access, String className) {
@@ -149,31 +143,25 @@
    */
   private void deleteRoleAccess(Role inheritFromToDelete,
       List<? extends InheritedAccessEnabled> roleAccessList, AccessTypeInjector injector) {
-    try {
-      OBContext.setAdminMode(false);
-      String inheritFromId = (String) DalUtil.getId(inheritFromToDelete);
-      List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();
-      for (InheritedAccessEnabled ih : roleAccessList) {
-        String inheritedFromId = ih.getInheritedFrom() != null ? (String) DalUtil.getId(ih
-            .getInheritedFrom()) : "";
-        if (!StringUtils.isEmpty(inheritedFromId) && inheritFromId.equals(inheritedFromId)) {
-          iaeToDelete.add(ih);
-        }
+    String inheritFromId = (String) DalUtil.getId(inheritFromToDelete);
+    List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();
+    for (InheritedAccessEnabled ih : roleAccessList) {
+      String inheritedFromId = ih.getInheritedFrom() != null ? (String) DalUtil.getId(ih
+          .getInheritedFrom()) : "";
+      if (!StringUtils.isEmpty(inheritedFromId) && inheritFromId.equals(inheritedFromId)) {
+        iaeToDelete.add(ih);
       }
-      for (InheritedAccessEnabled iae : iaeToDelete) {
-        iae.setInheritedFrom(null);
-        roleAccessList.remove(iae);
-        Role owner = injector.getRole(iae);
-        if (!owner.isTemplate()) {
-          // Perform this operation for not template roles, because for template roles is already
-          // done
-          // in the event handler
-          injector.removeReferenceInParentList(iae);
-        }
-        OBDal.getInstance().remove(iae);
+    }
+    for (InheritedAccessEnabled iae : iaeToDelete) {
+      iae.setInheritedFrom(null);
+      roleAccessList.remove(iae);
+      Role owner = injector.getRole(iae);
+      if (!owner.isTemplate()) {
+        // Perform this operation for not template roles, because for template roles is already done
+        // in the event handler
+        injector.removeReferenceInParentList(iae);
       }
-    } finally {
-      OBContext.restorePreviousMode();
+      OBDal.getInstance().remove(iae);
     }
   }
 
@@ -190,15 +178,10 @@
    */
   private void updateRoleAccess(InheritedAccessEnabled access, InheritedAccessEnabled inherited,
       AccessTypeInjector injector) {
-    try {
-      OBContext.setAdminMode(false);
-      final InheritedAccessEnabled updatedAccess = (InheritedAccessEnabled) DalUtil.copyToTarget(
-          (BaseOBObject) inherited, (BaseOBObject) access, false, injector.getSkippedProperties());
-      // update the inherit from field, to indicate from which role we are inheriting now
-      updatedAccess.setInheritedFrom(injector.getRole(inherited));
-    } finally {
-      OBContext.restorePreviousMode();
-    }
+    final InheritedAccessEnabled updatedAccess = (InheritedAccessEnabled) DalUtil.copyToTarget(
+        (BaseOBObject) inherited, (BaseOBObject) access, false, injector.getSkippedProperties());
+    // update the inherit from field, to indicate from which role we are inheriting now
+    updatedAccess.setInheritedFrom(injector.getRole(inherited));
   }
 
   /**
--- a/src/org/openbravo/role/inheritance/access/PreferenceAccessInjector.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/role/inheritance/access/PreferenceAccessInjector.java	Thu Jun 16 05:35:45 2016 +0000
@@ -25,7 +25,6 @@
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.base.structure.InheritedAccessEnabled;
 import org.openbravo.dal.core.DalUtil;
-import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.erpCommon.businessUtility.Preferences;
 import org.openbravo.erpCommon.utility.Utility;
@@ -40,7 +39,7 @@
 
   private static final Set<String> propertyBlackList = new HashSet<String>(Arrays.asList(
       "OBUIAPP_RecentDocumentsList", "OBUIAPP_RecentViewList", "OBUIAPP_GridConfiguration",
-      "OBUIAPP_DefaultSavedView", "UINAVBA_MenuRecentList", "UINAVBA_RecentLaunchList"));
+      "OBUIAPP_DefaultSavedView", "UINAVBA_RecentLaunchList"));
 
   @Override
   public String getSecuredElementGetter() {
@@ -73,11 +72,7 @@
   public Role getRole(InheritedAccessEnabled access) {
     // Preference does not have role property as parent
     Preference preference = (Preference) access;
-    if (preference.getVisibleAtRole() == null) {
-      return null;
-    }
-    String roleId = (String) DalUtil.getId(preference.getVisibleAtRole());
-    return OBDal.getInstance().get(Role.class, roleId);
+    return preference.getVisibleAtRole();
   }
 
   @Override
--- a/src/org/openbravo/service/rest/DalWebService.java	Fri Jun 10 09:50:42 2016 +0000
+++ b/src/org/openbravo/service/rest/DalWebService.java	Thu Jun 16 05:35:45 2016 +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) 2008-2016 Openbravo SLU
+ * All portions are Copyright (C) 2008-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -233,7 +233,6 @@
         final OBQuery<BaseOBObject> obq = OBDal.getInstance().createQuery(entityName,
             ID + " = :bobId");
         obq.setNamedParameter("bobId", id);
-        obq.setFilterOnActive(false);
         obq.setMaxResult(1);
         final BaseOBObject result = obq.uniqueResult();