Merged from PI
authorUnai Martirena <unai.martirena@openbravo.com>
Mon, 20 Jun 2016 09:04:10 +0200
changeset 29893 1ecece797a95
parent 29823 5e8fe1d85784 (current diff)
parent 29892 8b68b4e1e053 (diff)
child 29895 4b7e21d9a72e
Merged from PI
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/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/utilities/ob-utilities.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.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.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_ORDER_POST1.xml
src-db/database/model/functions/M_INOUT_POST.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_PROCESS.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_TABLE.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/AD_TREENODE.xml
src-db/database/sourcedata/AD_VAL_RULE.xml
src-db/database/sourcedata/OBUIAPP_PROCESS.xml
--- a/.hgsigs	Fri Jun 17 12:55:17 2016 +0200
+++ b/.hgsigs	Mon Jun 20 09:04:10 2016 +0200
@@ -194,3 +194,4 @@
 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 17 12:55:17 2016 +0200
+++ b/.hgtags	Mon Jun 20 09:04:10 2016 +0200
@@ -205,3 +205,4 @@
 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_AUXILIARINPUT.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -71,7 +71,7 @@
 <!--874CCFB2FE7B40D79D2B0AE27951853F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--874CCFB2FE7B40D79D2B0AE27951853F-->  <AD_TAB_ID><![CDATA[294]]></AD_TAB_ID>
 <!--874CCFB2FE7B40D79D2B0AE27951853F-->  <NAME><![CDATA[APRM_OrderIsPaid]]></NAME>
-<!--874CCFB2FE7B40D79D2B0AE27951853F-->  <CODE><![CDATA[@SQL=select case when ps.outstandingamt > 0 then 'N' else 'Y' end
+<!--874CCFB2FE7B40D79D2B0AE27951853F-->  <CODE><![CDATA[@SQL=select case when ps.outstandingamt <> 0 then 'N' else 'Y' end
           from fin_payment_scheduledetail fpsd
               join fin_payment_detail fpd on fpsd.fin_payment_detail_id=fpd.fin_payment_detail_id
               join fin_payment fp on fpd.fin_payment_id=fp.fin_payment_id
@@ -101,7 +101,7 @@
 <!--9FF4321DE0E5487B8A649A444F3F64BC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--9FF4321DE0E5487B8A649A444F3F64BC-->  <AD_TAB_ID><![CDATA[186]]></AD_TAB_ID>
 <!--9FF4321DE0E5487B8A649A444F3F64BC-->  <NAME><![CDATA[APRM_OrderIsPaid]]></NAME>
-<!--9FF4321DE0E5487B8A649A444F3F64BC-->  <CODE><![CDATA[@SQL=select case when ps.outstandingamt > 0 then 'N' else 'Y' end
+<!--9FF4321DE0E5487B8A649A444F3F64BC-->  <CODE><![CDATA[@SQL=select case when ps.outstandingamt <> 0 then 'N' else 'Y' end
           from fin_payment_scheduledetail fpsd
               join fin_payment_detail fpd on fpsd.fin_payment_detail_id=fpd.fin_payment_detail_id
               join fin_payment fp on fpd.fin_payment_id=fp.fin_payment_id
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.29661]]></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>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.29661]]></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/ModifyPaymentPlanActionHandler.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ModifyPaymentPlanActionHandler.java	Mon Jun 20 09:04:10 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2012 Openbravo SLU
+ * All portions are Copyright (C) 2012-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -270,15 +270,29 @@
       while (ite.hasNext()) {
         FIN_PaymentDetail pd = ite.next();
         BigDecimal amount = canceledPSDs.get(pd);
-        FIN_PaymentScheduleDetail psd = dao.getNewPaymentScheduleDetail(ps, null, amount,
-            BigDecimal.ZERO, pd);
-        psd.setCanceled(true);
+        if (!existsPaymentScheduleDetail(pd)) {
+          FIN_PaymentScheduleDetail psd = dao.getNewPaymentScheduleDetail(ps, null, amount,
+              BigDecimal.ZERO, pd);
+          psd.setCanceled(true);
+        }
       }
       return;
     }
   }
 
   /**
+   * Returns if exists any payment schedule detail for the payment detail
+   * 
+   */
+  private boolean existsPaymentScheduleDetail(FIN_PaymentDetail pd) {
+    OBCriteria<FIN_PaymentScheduleDetail> obcPSD = OBDal.getInstance().createCriteria(
+        FIN_PaymentScheduleDetail.class);
+    obcPSD.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS, pd));
+    obcPSD.setMaxResults(1);
+    return obcPSD.uniqueResult() != null;
+  }
+
+  /**
    * Returns the set of payment schedule detail elements for payments that have been canceled
    * 
    */
--- a/modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--8A098711BB324335A19833286BDB093D-->  <VERSION><![CDATA[1.0.29661]]></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>
--- a/modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--1467C397BC5F4999A5606F39CD6FF8A4-->  <STARTVERSION><![CDATA[2.1.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.29661]]></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>
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION><![CDATA[2.1.29661]]></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>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--15D7CE8D95D043189162DBABA54A1F61-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--60A170212F36499D83B8AD38D01F46B3-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--824D60CB352E4099B1D8C903CA139DAE-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--E8FD820AFE3D4FE08C02FC47769026AD-->  <STARTVERSION><![CDATA[8.1.29661]]></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/src/org/openbravo/client/application/report/ReportingUtils.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java	Mon Jun 20 09:04:10 2016 +0200
@@ -1162,7 +1162,7 @@
     SimplePdfExporterConfiguration configuration = reportConfiguration != null ? reportConfiguration
         : new SimplePdfExporterConfiguration();
 
-    reportConfiguration.setCreatingBatchModeBookmarks(createBookmarks);
+    configuration.setCreatingBatchModeBookmarks(createBookmarks);
     exporter.setConfiguration(configuration);
     exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));
     exporter.setExporterOutput(exporterOutput);
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-pick-and-execute-grid.js.ftl	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-pick-and-execute-grid.js.ftl	Mon Jun 20 09:04:10 2016 +0200
@@ -49,7 +49,7 @@
   </#if>  
   <#if data.alwaysFilterFksByIdentifier>
   alwaysFilterFksByIdentifier: ${data.alwaysFilterFksByIdentifier?string},
-  </#if>   
-  dummy: true
+  </#if>
+  alias: '${data.tableAlias?js_string}'
 </@compress>
 }
\ No newline at end of file
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Mon Jun 20 09:04:10 2016 +0200
@@ -47,8 +47,6 @@
 import org.openbravo.base.model.domaintype.PrimitiveDomainType;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.structure.BaseOBObject;
-import org.openbravo.base.structure.ClientEnabled;
-import org.openbravo.base.structure.OrganizationEnabled;
 import org.openbravo.client.application.ApplicationConstants;
 import org.openbravo.client.application.DynamicExpressionParser;
 import org.openbravo.client.application.Note;
@@ -63,6 +61,7 @@
 import org.openbravo.client.kernel.reference.UIDefinitionController;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.security.SecurityChecker;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
@@ -533,27 +532,10 @@
       }
 
       if ((mode.equals("EDIT") || mode.equals("CHANGE")) && row != null) {
-        if ((row instanceof ClientEnabled && ((ClientEnabled) row).getClient() != null)) {
-          final String rowClientId = ((ClientEnabled) row).getClient().getId();
-          final String currentClientId = OBContext.getOBContext().getCurrentClient().getId();
-          if (!rowClientId.equals(currentClientId)) {
-            finalObject.put("_readOnly", true);
-          }
+        if (!SecurityChecker.getInstance().isWritable(row)) {
+          finalObject.put("_readOnly", true);
         }
-        if (row instanceof OrganizationEnabled
-            && ((OrganizationEnabled) row).getOrganization() != null) {
-          boolean writable = false;
-          final String objectOrgId = ((OrganizationEnabled) row).getOrganization().getId();
-          for (String orgId : OBContext.getOBContext().getWritableOrganizations()) {
-            if (orgId.equals(objectOrgId)) {
-              writable = true;
-              break;
-            }
-          }
-          if (!writable) {
-            finalObject.put("_readOnly", true);
-          }
-        }
+
         finalObject.put("noteCount", noteCount);
       }
       if (attachments.size() > 0) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java	Mon Jun 20 09:04:10 2016 +0200
@@ -44,6 +44,7 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.ui.AuxiliaryInput;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.common.order.OrderLine;
@@ -442,4 +443,10 @@
     // if that datasource does not support filtering foreign keys using their ids
     return (dataSource != null && !dataSource.isSupportIdFkFiltering());
   }
+
+  public String getTableAlias() {
+    Table table = tab.getTable();
+    return "HQL".equals(table.getDataOriginType()) && !StringUtils.isBlank(table.getEntityAlias()) ? table
+        .getEntityAlias() : "e";
+  }
 }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-characteristics.js	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-characteristics.js	Mon Jun 20 09:04:10 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013-2015 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -519,12 +519,17 @@
   init: function () {
     var propertyPath, i, parentDSIdentifier = null,
         selectorDefinition = null;
+    this.canEdit = false;
 
     // Getting the product property in the entity we are filtering it.
     // It is obtained based on fieldName, in case its path is compound (i.e.
     // product$characteristicDescription), path is included up to the element
-    // previous to the last one
-    this.propertyName = 'e'; // "e" is the base entity
+    // previous to the last one 
+    if (this.grid && this.grid.parentElement && this.grid.parentElement.viewProperties && this.grid.parentElement.viewProperties.gridProperties && this.grid.parentElement.viewProperties.gridProperties.alias) {
+      this.propertyName = this.grid.parentElement.viewProperties.gridProperties.alias;
+    } else {
+      this.propertyName = 'e'; // "e" is the base entity
+    }
     propertyPath = this.getFieldName().split(OB.Constants.FIELDSEPARATOR);
     for (i = 0; i < propertyPath.length - 1; i++) {
       this.propertyName += '.' + propertyPath[i];
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js	Mon Jun 20 09:04:10 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011-2014 Openbravo SLU
+ * All portions are Copyright (C) 2011-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -430,8 +430,7 @@
     }
 
     // Apply the empty filter if the date text has been deleted
-    // See issue https://issues.openbravo.com/view.php?id=21697
-    if (newValue === '') {
+    if (newValue === '' && this.getFieldCriterionFromGrid()) {
       return true;
     }
 
@@ -456,6 +455,18 @@
     return false;
   },
 
+  getFieldCriterionFromGrid: function () {
+    var currentGridCriteria, fieldCriterion, criteria;
+    if (this.grid && this.grid.sourceWidget && this.grid.sourceWidget.getCriteria) {
+      currentGridCriteria = this.grid.sourceWidget.getCriteria();
+      if (currentGridCriteria) {
+        criteria = currentGridCriteria.criteria || [];
+        fieldCriterion = criteria.find('fieldName', this.getFieldName());
+      }
+    }
+    return fieldCriterion;
+  },
+
   clearFilterValues: function () {
     this.singleDateValue = null;
     this.singleDateDisplayValue = '';
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js	Mon Jun 20 09:04:10 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013-2014 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -91,11 +91,11 @@
       me.parentTabRecordId = me.getParentTabRecordId();
       dsRequest.params.parentRecordId = me.parentTabRecordId;
       dsRequest.params.tabId = me.view.tabId;
+      dsRequest.params._extraProperties = me.view.dataSource && me.view.dataSource.requestProperties.params._extraProperties;
       if (dsRequest.dropIndex || dsRequest.dropIndex === 0) {
         //Only send the index if the tree is ordered
         dsRequest = me.addOrderedTreeParameters(dsRequest);
       }
-      dsRequest.params._selectedProperties = me.getSelectedPropertiesString();
       // Includes the context, it could be used in the hqlwhereclause
       isc.addProperties(dsRequest.params, me.view.getContextInfo(true, false));
       dsRequest.willHandleError = true;
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Mon Jun 20 09:04:10 2016 +0200
@@ -1119,7 +1119,7 @@
     }
 
     if (localState.noFilterClause) {
-      if (OB.Utilities.isNonEmptyString(this.filterClause)) {
+      if (this.filterClause) {
         if (this.data) {
           this.data.forceRefresh = true;
         }
@@ -1133,7 +1133,7 @@
     }
 
     // and no additional filter clauses passed in
-    if (localState.filter && this.view.tabId !== this.view.standardWindow.additionalCriteriaTabId && this.view.tabId !== this.view.standardWindow.additionalFilterTabId) {
+    if (localState.filter && this.view.tabId !== this.view.standardWindow.additionalCriteriaTabId) {
       // a filtereditor but no editor yet
       // set it in the initialcriteria of the filterEditro
       if (this.filterEditor && !this.filterEditor.getEditForm()) {
@@ -1275,17 +1275,6 @@
       this.getField(this.view.parentProperty).canEdit = false;
     }
 
-    // Begins-added to have the additional filter clause and tabid..Mallikarjun M
-    // URL example:http://localhost:8080/openbravo/?tabId=186&filterClause=e.businessPartner.searchKey%3D%27mcgiver%27&replaceDefaultFilter=true&
-    if (this.view.tabId === this.view.standardWindow.additionalFilterTabId) {
-
-      if (!this.filterClause || this.view.standardWindow.replaceDefaultFilter === 'true') {
-        this.filterClause = unescape(this.view.standardWindow.additionalFilterClause);
-      } else if (this.filterClause) {
-        this.filterClause = '((' + this.filterClause + ') and (' + unescape(this.view.standardWindow.additionalFilterClause) + '))';
-      }
-    }
-    // Ends..
     if (this.view.tabId === this.view.standardWindow.additionalCriteriaTabId && this.view.standardWindow.additionalCriteria) {
       crit = isc.JSON.decode(unescape(this.view.standardWindow.additionalCriteria));
       this.setCriteria(crit);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-base-parameter-window-view.js	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-base-parameter-window-view.js	Mon Jun 20 09:04:10 2016 +0200
@@ -504,5 +504,12 @@
       activeView.viewGrid.enableShortcuts();
       activeView.toolBar.enableShortcuts();
     }
+  },
+
+  getBookMarkParams: function () {
+    var result = {};
+    result.viewId = this.getClassName();
+    result.tabTitle = this.tabTitle;
+    return result;
   }
 });
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-history-manager.js	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-history-manager.js	Mon Jun 20 09:04:10 2016 +0200
@@ -58,7 +58,8 @@
     updateHistory: function () {
 
       var state = {},
-          stateStr, data, i, tabsLength, tab, tabObject, tabWidgetNumber, previousWidgetsInTab = 0;
+          stateStr, data, i, tabsLength, tab, tabObject, tabWidgetNumber, previousWidgetsInTab = 0,
+          bookMarkParams;
 
       if (L.ViewManager.inStateHandling) {
         return;
@@ -75,6 +76,7 @@
       data = [];
       for (i = 0; i < tabsLength; i++) {
         tab = OB.MainView.TabSet.tabs[i];
+        bookMarkParams = null;
 
         if (tab.viewName !== 'OBQueryListView' && tab.viewName !== 'OBCalendarWidgetView') {
           state.bm[i] = {};
@@ -86,9 +88,17 @@
             viewId: tabObject.viewName
           };
 
+          // retrieve the bookmark parameters
+          if (tabObject.pane && tabObject.pane.getBookMarkParams) {
+            bookMarkParams = tabObject.pane.getBookMarkParams();
+          } else if (OB.MyOB && tabObject.myOB && tabObject.pane && tabObject.pane.isLoadingTab) {
+            // Workspace is not yet loaded, recovering its getBookMarkParams to avoid losing them
+            bookMarkParams = OB.MyOB.getBookMarkParams();
+          }
+
           // store the bookmark parameters
-          if (tabObject.pane && tabObject.pane.getBookMarkParams) {
-            state.bm[i].params = tabObject.pane.getBookMarkParams();
+          if (bookMarkParams) {
+            state.bm[i].params = bookMarkParams;
             if (!state.bm[i].params.tabTitle) {
               state.bm[i].params.tabTitle = tabObject.title;
             }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Mon Jun 20 09:04:10 2016 +0200
@@ -381,12 +381,6 @@
       }
     }
 
-    //// Begins-added to have the additional filter clause and tabid..Mallikarjun M
-    //URL example:http://localhost:8080/openbravo/?tabId=186&filterClause=e.businessPartner.searchKey%3D%27mcgiver%27&replaceDefaultFilter=true&
-    if (urlParams.filterClause) {
-      view.additionalFilterTabId = data.tabId;
-      view.additionalFilterClause = urlParams.filterClause;
-    }
     if (urlParams.criteria) {
       view.additionalCriteriaTabId = data.tabId;
       view.additionalCriteria = urlParams.criteria;
@@ -399,15 +393,10 @@
       view.emptyFilterClause = urlParams.emptyFilterClause;
     }
 
-    if (urlParams.replaceDefaultFilter) {
-      view.replaceDefaultFilter = urlParams.replaceDefaultFilter;
-    }
-
     if (criteria) {
       view.additionalCriteriaTabId = data.tabId;
       view.additionalCriteria = criteria;
     }
-    ////Ends..
     OB.Layout.ViewManager.openView(view.viewId, view, null, isDirect);
   };
 
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION><![CDATA[1.0.29661]]></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>
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--DCE798FBC5B648F7A3C81A6941720A57-->  <STARTVERSION><![CDATA[2.1.29661]]></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/jsbeautify/jsbeautify	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jsbeautify	Mon Jun 20 09:04:10 2016 +0200
@@ -24,7 +24,11 @@
 ./modules/org.openbravo.client.kernel/jsbeautify/jsbeautifier.py --indent-size=2 --jslint-happy "$changedfile" | perl -pe 'chop if eof' > "$changedfile.beautified"
 if ! diff "$changedfile" "$changedfile.beautified" >/dev/null ; then
   if [ "$replaceparam" != "replace" ] ; then
+    echo ""
+    echo "******************************************************************************************************************************************************"
     echo "Beautify Error --> Please, beautify $changedfile";
+    echo "******************************************************************************************************************************************************"
+    echo ""
     rm -rf "$changedfile.beautified"
     export ERROR="1"
   else
--- a/modules/org.openbravo.client.kernel/jsbeautify/jsbeautify-module	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jsbeautify-module	Mon Jun 20 09:04:10 2016 +0200
@@ -24,7 +24,11 @@
 ../org.openbravo.client.kernel/jsbeautify/jsbeautifier.py --indent-size=2 --jslint-happy "$changedfile" | perl -pe 'chop if eof' > "$changedfile.beautified"
 if ! diff "$changedfile" "$changedfile.beautified" >/dev/null ; then
   if [ "$replaceparam" != "replace" ] ; then
+    echo ""
+    echo "******************************************************************************************************************************************************"
     echo "Beautify Error --> Please, beautify $changedfile";
+    echo "******************************************************************************************************************************************************"
+    echo ""
     rm -rf "$changedfile.beautified"
     export ERROR="1"
   else
--- a/modules/org.openbravo.client.kernel/jsbeautify/jscheck-btfy	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jscheck-btfy	Mon Jun 20 09:04:10 2016 +0200
@@ -18,12 +18,16 @@
 
 set -e
 replaceparam=$1
+
+ echo ""
+ echo "-----------------------------------------------"
 if [ "$replaceparam" != "replace" ] ; then
  echo "Performing jsbeautify check on all js resources"
 else
  echo "Performing jsbeautify replacement on all js resources"
 fi
-
+ echo "-----------------------------------------------"
+ echo ""
 files=$(./modules/org.openbravo.client.kernel/jscheck/jsfiles ./modules)
 
 for changedfile in echo $files; do
--- a/modules/org.openbravo.client.kernel/jsbeautify/jscheck-btfy-module	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jscheck-btfy-module	Mon Jun 20 09:04:10 2016 +0200
@@ -18,12 +18,16 @@
 
 set -e
 replaceparam=$1
+
+ echo ""
+ echo "***********************************************"
 if [ "$replaceparam" != "replace" ] ; then
  echo "Performing jsbeautify check on all js resources"
 else
  echo "Performing jsbeautify replacement on all js resources"
 fi
-
+ echo "***********************************************"
+ echo ""
 files=$(../org.openbravo.client.kernel/jscheck/jsfiles ./)
 
 for changedfile in echo $files;
--- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION><![CDATA[2.1.29661]]></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>
--- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--26B041893E844A53AFA58BC326C4F0D7-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <STARTVERSION><![CDATA[1.1.29661]]></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.28838]]></STARTVERSION>
+<!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <STARTVERSION><![CDATA[2.0.29661]]></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.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java	Mon Jun 20 09:04:10 2016 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2011 Openbravo SLU 
+ * All portions are Copyright (C) 2011-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -82,7 +82,7 @@
     Date date = null;
     try {
       // We retrieve the time from the database, using the predefined sql date-time format
-      String now = DateTimeData.now(new DalConnectionProvider(), sqlDateTimeFormat);
+      String now = DateTimeData.now(new DalConnectionProvider(false), sqlDateTimeFormat);
       SimpleDateFormat formatter = new SimpleDateFormat(javaDateTimeFormat);
       date = formatter.parse(now);
     } catch (Exception ex) {
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION><![CDATA[2.1.29661]]></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>
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--15F51F03882F444CAB6593B4566DC929-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--E71B28FC949D481D9F59C17D01E46EF9-->  <STARTVERSION><![CDATA[3.0.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION><![CDATA[1.0.29661]]></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>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--26558497C31140BFAB067BA4BC47D799-->  <STARTVERSION><![CDATA[2.1.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--FF8080812D842086012D844F3CC0003E-->  <VERSION><![CDATA[0.0.29661]]></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>
--- a/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--FF8080812D842086012D845002070046-->  <STARTVERSION><![CDATA[2.1.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION><![CDATA[3.0.29661]]></VERSION>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <DESCRIPTION><![CDATA[Payment Report]]></DESCRIPTION>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <URL><![CDATA[http://forge.openbravo.com/projects/paymentreport]]></URL>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <TYPE><![CDATA[M]]></TYPE>
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--A3B449C4D5FE4D688CC58236FE33B802-->  <STARTVERSION><![CDATA[3.0.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION><![CDATA[1.1.29661]]></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>
--- a/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <STARTVERSION><![CDATA[3.0.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION><![CDATA[2.1.29661]]></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>
--- a/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <STARTVERSION><![CDATA[1.1.29661]]></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.28838]]></STARTVERSION>
+<!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <STARTVERSION><![CDATA[2.0.29661]]></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.28838]]></STARTVERSION>
+<!--4FCE95802A854F7E8623AFF7C33D13EE-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--54AF8B39C55E4E7496902893ECD82786-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--D03C56D8A4E14F45A5466350E05C631F-->  <STARTVERSION><![CDATA[8.1.29661]]></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/ADTreeDatasourceService.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java	Mon Jun 20 09:04:10 2016 +0200
@@ -51,7 +51,6 @@
 import org.openbravo.erpCommon.businessUtility.Preferences;
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.domain.ReferencedTree;
-import org.openbravo.model.ad.domain.ReferencedTreeField;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.utility.TableTree;
@@ -196,19 +195,9 @@
     String tabId = parameters.get("tabId");
     String treeReferenceId = parameters.get("treeReferenceId");
     Tab tab = null;
-    JSONArray selectedProperties = null;
     if (tabId != null) {
       tab = OBDal.getInstance().get(Tab.class, tabId);
-      String selectedPropertiesStr = parameters.get("_selectedProperties");
-      selectedProperties = new JSONArray(selectedPropertiesStr);
-    } else if (treeReferenceId != null) {
-      ReferencedTree treeReference = OBDal.getInstance().get(ReferencedTree.class, treeReferenceId);
-      treeReference.getADReferencedTreeFieldList();
-      selectedProperties = new JSONArray();
-      for (ReferencedTreeField treeField : treeReference.getADReferencedTreeFieldList()) {
-        selectedProperties.put(treeField.getProperty());
-      }
-    } else {
+    } else if (treeReferenceId == null) {
       logger
           .error("A request to the TreeDatasourceService must include the tabId or the treeReferenceId parameter");
       return new JSONArray();
@@ -219,6 +208,7 @@
     Entity entity = ModelProvider.getInstance().getEntityByTableId(tree.getTable().getId());
     final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(
         DataToJsonConverter.class);
+    toJsonConverter.setAdditionalProperties(JsonUtils.getAdditionalProperties(parameters));
 
     // Joins the ADTreeNode with the referenced table
     StringBuilder joinClause = new StringBuilder();
@@ -350,6 +340,7 @@
     OBQuery<BaseOBObject> obq = OBDal.getInstance()
         .createQuery("ADTreeNode", joinClause.toString());
     obq.setFilterOnActive(false);
+    obq.setFilterOnReadableOrganization(entity.getMappingClass() != Organization.class);
     final List<Object> parameters = new ArrayList<Object>();
     parameters.add(nodeId);
     obq.setParameters(parameters);
@@ -563,19 +554,11 @@
     String tableId = null;
     String referencedTableId = parameters.get("referencedTableId");
     String treeReferenceId = parameters.get("treeReferenceId");
-    JSONArray selectedProperties = null;
     if (referencedTableId != null) {
       tableId = referencedTableId;
-      String selectedPropertiesStr = parameters.get("_selectedProperties");
-      selectedProperties = new JSONArray(selectedPropertiesStr);
     } else if (treeReferenceId != null) {
       ReferencedTree treeReference = OBDal.getInstance().get(ReferencedTree.class, treeReferenceId);
-      treeReference.getADReferencedTreeFieldList();
       tableId = treeReference.getTable().getId();
-      selectedProperties = new JSONArray();
-      for (ReferencedTreeField treeField : treeReference.getADReferencedTreeFieldList()) {
-        selectedProperties.put(treeField.getProperty());
-      }
     } else {
       logger
           .error("A request to the TreeDatasourceService must include the tabId or the treeReferenceId parameter");
@@ -650,6 +633,7 @@
 
     final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(
         DataToJsonConverter.class);
+    toJsonConverter.setAdditionalProperties(JsonUtils.getAdditionalProperties(parameters));
 
     JSONObject json = null;
     try {
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java	Mon Jun 20 09:04:10 2016 +0200
@@ -64,6 +64,8 @@
 import org.slf4j.LoggerFactory;
 
 public class HQLDataSourceService extends ReadOnlyDataSourceService {
+  public static final String PROPERTY_FIELD_SEPARATOR = "___";
+
   private static final Logger log = LoggerFactory.getLogger(HQLDataSourceService.class);
   private static final String AND = " AND ";
   private static final String WHERE = " WHERE ";
@@ -75,6 +77,7 @@
   private static final String INSERTION_POINT_GENERIC_ID = "@insertion_point_#@";
   private static final String INSERTION_POINT_INDEX_PLACEHOLDER = "#";
   private static final String DUMMY_INSERTION_POINT_REPLACEMENT = " 1 = 1 ";
+
   @Inject
   @Any
   private Instance<HqlInserter> hqlInserters;
@@ -205,13 +208,21 @@
       } else {
         Object[] properties = (Object[]) row;
         for (int i = 0; i < returnAliases.length; i++) {
-          Property property = entity.getPropertyByColumnName(returnAliases[i].toLowerCase(),
-              checkIsNotNull);
-          if (property == null) {
-            property = entity.getPropertyByColumnName(columns.get(i).getDBColumnName()
-                .toLowerCase());
+          String aliasName = returnAliases[i];
+          String propertyName;
+          if (aliasName.contains(PROPERTY_FIELD_SEPARATOR)) {
+            propertyName = aliasName.replace(PROPERTY_FIELD_SEPARATOR,
+                JsonConstants.FIELD_SEPARATOR);
+          } else {
+            Property property = entity.getPropertyByColumnName(aliasName.toLowerCase(),
+                checkIsNotNull);
+            if (property == null) {
+              property = entity.getPropertyByColumnName(columns.get(i).getDBColumnName()
+                  .toLowerCase());
+            }
+            propertyName = property.getName();
           }
-          record.put(property.getName(), properties[i]);
+          record.put(propertyName, properties[i]);
         }
       }
       data.add(record);
--- a/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--FF8080813129ADA401312CA1222A0005-->  <VERSION><![CDATA[0.1.29661]]></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.
--- a/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--FF8080813141B198013141BA0F7D0012-->  <STARTVERSION><![CDATA[0.1.29661]]></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.28838]]></STARTVERSION>
+<!--FF8080813151AEE1013151C4ACE6001B-->  <STARTVERSION><![CDATA[2.1.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--FF8080813141B198013141B86DD70003-->  <VERSION><![CDATA[0.1.29661]]></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.
--- a/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--FF8080813141B198013141B8B21B0006-->  <STARTVERSION><![CDATA[3.0.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION><![CDATA[2.0.29661]]></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>
--- a/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--9E3E7B42DB16405FB794496D309D7044-->  <STARTVERSION><![CDATA[3.0.29661]]></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/DataToJsonConverter.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Mon Jun 20 09:04:10 2016 +0200
@@ -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-2014 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -103,7 +103,7 @@
         for (String key : dataInstance.keySet()) {
           Property property = null;
           if (this.entity != null) {
-            property = entity.getProperty(key);
+            property = entity.getProperty(key, false);
           }
           final Object value = dataInstance.get(key);
           if (value instanceof BaseOBObject) {
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Mon Jun 20 09:04:10 2016 +0200
@@ -50,6 +50,8 @@
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.database.SessionInfo;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.ad.system.Client;
+import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.service.db.DbUtility;
 import org.openbravo.service.json.JsonToDataConverter.JsonConversionError;
 import org.openbravo.userinterface.selector.Selector;
@@ -642,12 +644,12 @@
 
   private void addWritableAttribute(List<JSONObject> jsonObjects) throws JSONException {
     for (JSONObject jsonObject : jsonObjects) {
-      if (!jsonObject.has("client") || !jsonObject.has("organization")) {
-        continue;
-      }
-      final Object rowClient = jsonObject.get("client");
-      final Object rowOrganization = jsonObject.get("organization");
-      if (!(rowClient instanceof String) || !(rowOrganization instanceof String)) {
+      final Object rowClient = getFKValue(jsonObject, "client", Client.ENTITY_NAME);
+      final Object rowOrganization = getFKValue(jsonObject, "organization",
+          Organization.ENTITY_NAME);
+
+      if (rowClient == null || !(rowClient instanceof String) || rowOrganization == null
+          || !(rowOrganization instanceof String)) {
         continue;
       }
       final String currentClientId = OBContext.getOBContext().getCurrentClient().getId();
@@ -668,6 +670,23 @@
     }
   }
 
+  /**
+   * Returns the value for a FK property, in case the entity of the row is the referencedEntity for
+   * that FK, it returns the row id.
+   */
+  private Object getFKValue(JSONObject row, String propertyName,
+      String referencedEntityName) throws JSONException {
+    Object value = null;
+    if (row.has(propertyName)) {
+      value = row.get(propertyName);
+    } else if (row.has(JsonConstants.ENTITYNAME)
+        && referencedEntityName.equals(row.get(JsonConstants.ENTITYNAME))
+        && row.has(BaseOBObject.ID)) {
+      value = row.get(BaseOBObject.ID);
+    }
+    return value;
+  }
+
   /*
    * (non-Javadoc)
    * 
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonConstants.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonConstants.java	Mon Jun 20 09:04:10 2016 +0200
@@ -131,4 +131,5 @@
 
   public static final String UNDEFINED = "undefined";
   public static final String NULL = "null";
+  public static final String FIELD_SEPARATOR = "$";
 }
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION><![CDATA[2.1.29661]]></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>
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--38825CAED43941D38CA0C78DB04FCFA0-->  <STARTVERSION><![CDATA[8.1.29661]]></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.28838]]></STARTVERSION>
+<!--6DDE7B1A70174242AF82B5022FB89279-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--94F9CD2CB5EF4467A67475C786C984A7-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <STARTVERSION><![CDATA[1.1.29661]]></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.28838]]></STARTVERSION>
+<!--C8DAC574B88649D08C9468521B343F12-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--F14EB17946BE4724A46F80CB1A47EC70-->  <STARTVERSION><![CDATA[2.1.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION><![CDATA[2.0.29661]]></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>
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--39BF75AD9AB3453698BF5DE29E727AA9-->  <STARTVERSION><![CDATA[3.0.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION><![CDATA[8.1.29661]]></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>
--- a/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--086331E18477496B8AC74D2CFEBD1307-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--DC5D4EF450244482BD2B458DAA496333-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--F2AF15C0AF5540E393D96BE506E20648-->  <STARTVERSION><![CDATA[1.1.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--8A34B301DC524EA3A07513DF9F42CC90-->  <VERSION><![CDATA[1.0.29661]]></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>
--- a/modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--86EBD30DEB8045508185B457896C9F6D-->  <STARTVERSION><![CDATA[2.1.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION><![CDATA[3.0.29661]]></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
--- a/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--148A000EE9A04A3CA653B1296A00B8E6-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--30F966407A6F4E15965821BAEE34D25B-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--F93CE30003B24F8F8886510B0065EECC-->  <STARTVERSION><![CDATA[1.1.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION><![CDATA[2.1.29661]]></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>
--- a/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--01E1BCCEC9114DE0960538DF34E30E6F-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--025B181F63CA47B48A920F6983242390-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--054B4FEAF919478AA3FF27098A46D1D6-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <STARTVERSION><![CDATA[1.0.29661]]></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.28838]]></STARTVERSION>
+<!--224754C3EF674C93B0D468F47BAAB824-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--5B72D24032DD4879A950194139D961B6-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--8730CA6A4224439D82E0DD31B3806E36-->  <STARTVERSION><![CDATA[1.0.29661]]></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.28838]]></STARTVERSION>
+<!--98C47FF058F8413B8A2B26036061446E-->  <STARTVERSION><![CDATA[8.1.29661]]></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.28838]]></STARTVERSION>
+<!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <STARTVERSION><![CDATA[2.0.29661]]></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.28838]]></STARTVERSION>
+<!--A9CB99330AF34944877F889DD8A0AB3C-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--E72A053A403C4A98A189C105B850ADB0-->  <STARTVERSION><![CDATA[1.1.29661]]></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.28838]]></STARTVERSION>
+<!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <STARTVERSION><![CDATA[2.0.29661]]></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 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION><![CDATA[3.0.29661]]></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>
--- a/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></STARTVERSION>
+<!--48D556894CE54CF998DC97882E904CBD-->  <STARTVERSION><![CDATA[1.0.29661]]></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.28838]]></STARTVERSION>
+<!--4D11E3A70650475381139522373CD191-->  <STARTVERSION><![CDATA[2.1.29661]]></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.28838]]></STARTVERSION>
+<!--52CE523C40634C47A99C6EBBD9C3125C-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--60834727BB114764ACEF019F40A34562-->  <STARTVERSION><![CDATA[1.1.29661]]></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.28838]]></STARTVERSION>
+<!--8418885E97D643138B6D907671351E3D-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--A32F3279B3374FC0A6CFEA2368BB7053-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <STARTVERSION><![CDATA[3.0.29661]]></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.28838]]></STARTVERSION>
+<!--FEF6E40F244A4061B7C62CB755663712-->  <STARTVERSION><![CDATA[1.0.29661]]></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.28838]]></STARTVERSION>
+<!--FF8080813189932B013189B45B59003A-->  <STARTVERSION><![CDATA[0.1.29661]]></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.28838]]></STARTVERSION>
+<!--FF8080813189932B013189B4C00F003D-->  <STARTVERSION><![CDATA[0.1.29661]]></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.28838]]></STARTVERSION>
+<!--FF8081812E2F6F3C012E2F750109001C-->  <STARTVERSION><![CDATA[0.0.29661]]></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-core/src/org/openbravo/data/Sqlc.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-core/src/org/openbravo/data/Sqlc.java	Mon Jun 20 09:04:10 2016 +0200
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2015 Openbravo S.L.U.
+ * Copyright (C) 2001-2016 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
@@ -736,10 +736,9 @@
       // Get the ResultSetMetaData. This will be used for
       // the column headings
       if (sql.executeType.equals("executeQuery")) {
-        result = preparedStatement.executeQuery();
-        if (log4j.isDebugEnabled())
-          log4j.debug("query done");
-        rsmd = result.getMetaData();
+        // No need to really run the query. Both pg & ora allow to get ResultSetMetaData from a
+        // PreparedStatement already
+        rsmd = preparedStatement.getMetaData();
         // Get the number of columns in the result set
         numCols = rsmd.getColumnCount();
         if (log4j.isDebugEnabled())
@@ -1515,7 +1514,7 @@
           if (parameter.strInOut.equals("out")) {
             outParamName = parameter.strName;
             paramsReceipt.append("      object").append(sql.sqlObject).append(".")
-                .append(outParamName).append(" = (String) vecTotal.elementAt(").append(outParams)
+                .append(outParamName).append(" = vecTotal.elementAt(").append(outParams)
                 .append(");\n");
             outParams++;
           }
--- a/src-db/database/model/functions/C_ORDER_POST1.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -149,6 +149,9 @@
       LOOP
         v_Record_ID:=Cur_Parameter.Record_ID;
         v_User:=Cur_Parameter.AD_User_ID;
+        IF (Cur_Parameter.ParameterName = 'recalculateDiscounts') THEN
+          v_recalculateDiscounts := Cur_Parameter.P_String;
+        END IF;
       END LOOP; -- Get Parameter
     ELSE
       v_Record_ID:=p_Order_ID;
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -95,6 +95,8 @@
     v_QtyAux NUMBER;
     v_Count NUMBER:=0;
     v_Line VARCHAR2(10) ;
+    v_OrderDocumentNo C_ORDER.DocumentNo%TYPE;
+    v_OrderLineNo C_ORDERLINE.Line%TYPE;
     v_OrderID_old VARCHAR2(32);
     Cur_MILines RECORD;
     FINISH_PROCESS BOOLEAN:=false;
@@ -353,18 +355,26 @@
         IF (v_Count=0) THEN
           RAISE_APPLICATION_ERROR(-20000, '@NotCorrectOrgDoctypeShipment@') ;
         END IF;
-        SELECT COUNT(*), MAX(M.line)
-        INTO v_Count, v_line
-        FROM M_InOutLine M,
-          M_Product P
-        WHERE M.M_PRODUCT_ID=P.M_PRODUCT_ID
-          AND P.M_ATTRIBUTESET_ID IS NOT NULL
+        SELECT COUNT(*), MAX(M.line), MAX(O.documentno), Max(OL.line)
+        INTO v_Count, v_line, v_OrderDocumentNo, v_OrderLineNo
+        FROM M_InOutLine M
+        JOIN M_Product P
+        ON M.m_product_id = P.m_product_id
+        LEFT JOIN C_OrderLine OL
+        ON M.c_orderline_id = OL.c_orderline_id
+        LEFT JOIN C_Order O
+        ON OL.c_order_id = O.c_order_id
+        WHERE P.M_ATTRIBUTESET_ID IS NOT NULL
           AND (P.ATTRSETVALUETYPE IS NULL OR P.ATTRSETVALUETYPE <> 'F')
           AND (SELECT ISONEATTRSETVALREQUIRED FROM M_ATTRIBUTESET WHERE M_ATTRIBUTESET_ID = P.M_ATTRIBUTESET_ID) = 'Y'
           AND COALESCE(M.M_ATTRIBUTESETINSTANCE_ID, '0') = '0'
           AND M.M_INOUT_ID=v_Record_ID;
-        IF v_Count<>0 THEN
-          RAISE_APPLICATION_ERROR(-20000, '@Inline@'||' '||v_line||' '||'@productWithoutAttributeSet@') ;
+        IF (v_Count <> 0) THEN
+          IF (v_orderDocumentNo IS NULL) THEN
+            RAISE_APPLICATION_ERROR(-20000, '@Inline@'||' '||v_line||' '||'@productWithoutAttributeSet@');
+          ELSE
+            RAISE_APPLICATION_ERROR(-20000, '@Inline@'||' '||v_line||' '||'@productWithoutAttributeSet@'||'. '||'@INS_POREFERENCE@'||' '||v_OrderDocumentNo||' '||'@line@'||' '||v_OrderLineNo);
+          END IF;
         END IF;
         SELECT COUNT(*), MAX(M.line)
         INTO v_Count, v_Line
--- a/src-db/database/sourcedata/AD_MENU.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/sourcedata/AD_MENU.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -4952,6 +4952,20 @@
 <!--6787A809DB364371B797ECED5E9262BF-->  <OPENLINKINBROWSER><![CDATA[N]]></OPENLINKINBROWSER>
 <!--6787A809DB364371B797ECED5E9262BF--></AD_MENU>
 
+<!--68516F327BFE4CDEB2DA255122089917--><AD_MENU>
+<!--68516F327BFE4CDEB2DA255122089917-->  <AD_MENU_ID><![CDATA[68516F327BFE4CDEB2DA255122089917]]></AD_MENU_ID>
+<!--68516F327BFE4CDEB2DA255122089917-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--68516F327BFE4CDEB2DA255122089917-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--68516F327BFE4CDEB2DA255122089917-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--68516F327BFE4CDEB2DA255122089917-->  <NAME><![CDATA[Reset Accounting]]></NAME>
+<!--68516F327BFE4CDEB2DA255122089917-->  <DESCRIPTION><![CDATA[Reset Accounting Entries]]></DESCRIPTION>
+<!--68516F327BFE4CDEB2DA255122089917-->  <ISSUMMARY><![CDATA[N]]></ISSUMMARY>
+<!--68516F327BFE4CDEB2DA255122089917-->  <ACTION><![CDATA[OBUIAPP_Process]]></ACTION>
+<!--68516F327BFE4CDEB2DA255122089917-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--68516F327BFE4CDEB2DA255122089917-->  <OPENLINKINBROWSER><![CDATA[N]]></OPENLINKINBROWSER>
+<!--68516F327BFE4CDEB2DA255122089917-->  <EM_OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></EM_OBUIAPP_PROCESS_ID>
+<!--68516F327BFE4CDEB2DA255122089917--></AD_MENU>
+
 <!--6EEC8E0853CB432B886B8751A73F5E28--><AD_MENU>
 <!--6EEC8E0853CB432B886B8751A73F5E28-->  <AD_MENU_ID><![CDATA[6EEC8E0853CB432B886B8751A73F5E28]]></AD_MENU_ID>
 <!--6EEC8E0853CB432B886B8751A73F5E28-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -5272,7 +5286,7 @@
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <AD_MENU_ID><![CDATA[CC8E287A0B0743D69C53D8F678F9AD41]]></AD_MENU_ID>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--CC8E287A0B0743D69C53D8F678F9AD41-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CC8E287A0B0743D69C53D8F678F9AD41-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <NAME><![CDATA[Reset Accounting]]></NAME>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <DESCRIPTION><![CDATA[Reset Accounting Entries]]></DESCRIPTION>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <ISSUMMARY><![CDATA[N]]></ISSUMMARY>
--- a/src-db/database/sourcedata/AD_MODULE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -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.28838]]></VERSION>
+<!--0-->  <VERSION><![CDATA[3.0.29661]]></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>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -7162,7 +7162,7 @@
 <!--E264309FF8244A94936502BF51829109-->  <AD_PROCESS_ID><![CDATA[E264309FF8244A94936502BF51829109]]></AD_PROCESS_ID>
 <!--E264309FF8244A94936502BF51829109-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--E264309FF8244A94936502BF51829109-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--E264309FF8244A94936502BF51829109-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E264309FF8244A94936502BF51829109-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
 <!--E264309FF8244A94936502BF51829109-->  <VALUE><![CDATA[Reset Accounting]]></VALUE>
 <!--E264309FF8244A94936502BF51829109-->  <NAME><![CDATA[Reset Accounting]]></NAME>
 <!--E264309FF8244A94936502BF51829109-->  <DESCRIPTION><![CDATA[Reset Accounting Entries]]></DESCRIPTION>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -4926,6 +4926,18 @@
 <!--4452E6997DD14363AB4387B06939871A-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--4452E6997DD14363AB4387B06939871A--></AD_REFERENCE>
 
+<!--45134B97CEF74E27AD2A5D8E8DC8D388--><AD_REFERENCE>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <AD_REFERENCE_ID><![CDATA[45134B97CEF74E27AD2A5D8E8DC8D388]]></AD_REFERENCE_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <NAME><![CDATA[Client Selector]]></NAME>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <PARENTREFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></PARENTREFERENCE_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388--></AD_REFERENCE>
+
 <!--467CA50808444F9890E23536FDE10405--><AD_REFERENCE>
 <!--467CA50808444F9890E23536FDE10405-->  <AD_REFERENCE_ID><![CDATA[467CA50808444F9890E23536FDE10405]]></AD_REFERENCE_ID>
 <!--467CA50808444F9890E23536FDE10405-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -5392,6 +5404,18 @@
 <!--66F2DCC800A34F94923444C29478E70A-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--66F2DCC800A34F94923444C29478E70A--></AD_REFERENCE>
 
+<!--682B6F47F6B147008D0454FEACB9F4C7--><AD_REFERENCE>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <AD_REFERENCE_ID><![CDATA[682B6F47F6B147008D0454FEACB9F4C7]]></AD_REFERENCE_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <NAME><![CDATA[Table Multi Selector]]></NAME>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <PARENTREFERENCE_ID><![CDATA[87E6CFF8F71548AFA33F181C317970B5]]></PARENTREFERENCE_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--682B6F47F6B147008D0454FEACB9F4C7--></AD_REFERENCE>
+
 <!--689DF2175C944B70AF0DF7D57C3411A6--><AD_REFERENCE>
 <!--689DF2175C944B70AF0DF7D57C3411A6-->  <AD_REFERENCE_ID><![CDATA[689DF2175C944B70AF0DF7D57C3411A6]]></AD_REFERENCE_ID>
 <!--689DF2175C944B70AF0DF7D57C3411A6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -6201,6 +6225,18 @@
 <!--C123B7BF5B2C438D84D2E509734776B5-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--C123B7BF5B2C438D84D2E509734776B5--></AD_REFERENCE>
 
+<!--C205D56B07D74778A6D6A1AED8467690--><AD_REFERENCE>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <AD_REFERENCE_ID><![CDATA[C205D56B07D74778A6D6A1AED8467690]]></AD_REFERENCE_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <NAME><![CDATA[Legal or Business Organizations Selector]]></NAME>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <PARENTREFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></PARENTREFERENCE_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--C205D56B07D74778A6D6A1AED8467690--></AD_REFERENCE>
+
 <!--C3531F85C14B4515AB7259F0D338050D--><AD_REFERENCE>
 <!--C3531F85C14B4515AB7259F0D338050D-->  <AD_REFERENCE_ID><![CDATA[C3531F85C14B4515AB7259F0D338050D]]></AD_REFERENCE_ID>
 <!--C3531F85C14B4515AB7259F0D338050D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TREENODE.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/sourcedata/AD_TREENODE.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -121,6 +121,17 @@
 <!--336590D9E14D4C269480543BA8A31321-->  <SEQNO><![CDATA[140]]></SEQNO>
 <!--336590D9E14D4C269480543BA8A31321--></AD_TREENODE>
 
+<!--3754425FEBD3407FAAE48E832F330E5A--><AD_TREENODE>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <AD_TREENODE_ID><![CDATA[3754425FEBD3407FAAE48E832F330E5A]]></AD_TREENODE_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <NODE_ID><![CDATA[68516F327BFE4CDEB2DA255122089917]]></NODE_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <PARENT_ID><![CDATA[800254]]></PARENT_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--3754425FEBD3407FAAE48E832F330E5A--></AD_TREENODE>
+
 <!--3887BEFE9C8C43B892367AA37B0FC04A--><AD_TREENODE>
 <!--3887BEFE9C8C43B892367AA37B0FC04A-->  <AD_TREENODE_ID><![CDATA[3887BEFE9C8C43B892367AA37B0FC04A]]></AD_TREENODE_ID>
 <!--3887BEFE9C8C43B892367AA37B0FC04A-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
@@ -4153,7 +4164,7 @@
 <!--8E286E545FC6433F8BADCF02254A8C14-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8E286E545FC6433F8BADCF02254A8C14-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8E286E545FC6433F8BADCF02254A8C14-->  <PARENT_ID><![CDATA[800254]]></PARENT_ID>
-<!--8E286E545FC6433F8BADCF02254A8C14-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--8E286E545FC6433F8BADCF02254A8C14-->  <SEQNO><![CDATA[110]]></SEQNO>
 <!--8E286E545FC6433F8BADCF02254A8C14--></AD_TREENODE>
 
 <!--955B7E22F1B94135A25F867F8DC7A35D--><AD_TREENODE>
--- a/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -72,6 +72,31 @@
 <!--0AC32C93E78E47FBA10B62CB1AE72303-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
 <!--0AC32C93E78E47FBA10B62CB1AE72303--></OBUIAPP_PARAMETER>
 
+<!--14CEFF8FDC6A4A148BB89C921E5570FA--><OBUIAPP_PARAMETER>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <OBUIAPP_PARAMETER_ID><![CDATA[14CEFF8FDC6A4A148BB89C921E5570FA]]></OBUIAPP_PARAMETER_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <NAME><![CDATA[Ending Date]]></NAME>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <DESCRIPTION><![CDATA[A parameter stating the ending time range related for a specified request, query, etc.]]></DESCRIPTION>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <HELP><![CDATA[The Date To indicates the end date of a range (inclusive)]]></HELP>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <COLUMNNAME><![CDATA[dateto]]></COLUMNNAME>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_ELEMENT_ID><![CDATA[1582]]></AD_ELEMENT_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA--></OBUIAPP_PARAMETER>
+
 <!--19B6A6E74EC8497E956F2EBE96096226--><OBUIAPP_PARAMETER>
 <!--19B6A6E74EC8497E956F2EBE96096226-->  <OBUIAPP_PARAMETER_ID><![CDATA[19B6A6E74EC8497E956F2EBE96096226]]></OBUIAPP_PARAMETER_ID>
 <!--19B6A6E74EC8497E956F2EBE96096226-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -97,6 +122,33 @@
 <!--19B6A6E74EC8497E956F2EBE96096226-->  <EM_OBKMO_WIDGET_CLASS_ID><![CDATA[7EE694CFF8B94B4C9B9CE69C9D292CC4]]></EM_OBKMO_WIDGET_CLASS_ID>
 <!--19B6A6E74EC8497E956F2EBE96096226--></OBUIAPP_PARAMETER>
 
+<!--1AEB6EE93F7842D38F9F2F0835A56483--><OBUIAPP_PARAMETER>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <OBUIAPP_PARAMETER_ID><![CDATA[1AEB6EE93F7842D38F9F2F0835A56483]]></OBUIAPP_PARAMETER_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <NAME><![CDATA[Client]]></NAME>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_REFERENCE_VALUE_ID><![CDATA[45134B97CEF74E27AD2A5D8E8DC8D388]]></AD_REFERENCE_VALUE_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <COLUMNNAME><![CDATA[AD_Client_ID]]></COLUMNNAME>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <DEFAULTVALUE><![CDATA[OB.getContext().getCurrentClient().id]]></DEFAULTVALUE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_ELEMENT_ID><![CDATA[102]]></AD_ELEMENT_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--1AEB6EE93F7842D38F9F2F0835A56483--></OBUIAPP_PARAMETER>
+
 <!--1F29EB4AE5C44C789C9895722D8A6AD5--><OBUIAPP_PARAMETER>
 <!--1F29EB4AE5C44C789C9895722D8A6AD5-->  <OBUIAPP_PARAMETER_ID><![CDATA[1F29EB4AE5C44C789C9895722D8A6AD5]]></OBUIAPP_PARAMETER_ID>
 <!--1F29EB4AE5C44C789C9895722D8A6AD5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -148,6 +200,31 @@
 <!--282411DB886F438C90D43C0BFBABFE68-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
 <!--282411DB886F438C90D43C0BFBABFE68--></OBUIAPP_PARAMETER>
 
+<!--39F2F7282EC14B58A10E4FC33F13744F--><OBUIAPP_PARAMETER>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <OBUIAPP_PARAMETER_ID><![CDATA[39F2F7282EC14B58A10E4FC33F13744F]]></OBUIAPP_PARAMETER_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <NAME><![CDATA[Starting Date]]></NAME>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <DESCRIPTION><![CDATA[A parameter stating the starting time range related to a specified request.]]></DESCRIPTION>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <HELP><![CDATA[The Date From indicates the starting date of a range.]]></HELP>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <COLUMNNAME><![CDATA[datefrom]]></COLUMNNAME>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_ELEMENT_ID><![CDATA[1581]]></AD_ELEMENT_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--39F2F7282EC14B58A10E4FC33F13744F--></OBUIAPP_PARAMETER>
+
 <!--3DA90EDE17724374A90089F096D59949--><OBUIAPP_PARAMETER>
 <!--3DA90EDE17724374A90089F096D59949-->  <OBUIAPP_PARAMETER_ID><![CDATA[3DA90EDE17724374A90089F096D59949]]></OBUIAPP_PARAMETER_ID>
 <!--3DA90EDE17724374A90089F096D59949-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -199,6 +276,32 @@
 <!--439E00644F0647B397201C0C099D60E4-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
 <!--439E00644F0647B397201C0C099D60E4--></OBUIAPP_PARAMETER>
 
+<!--47F7B399D2BA434E861B14D07583173F--><OBUIAPP_PARAMETER>
+<!--47F7B399D2BA434E861B14D07583173F-->  <OBUIAPP_PARAMETER_ID><![CDATA[47F7B399D2BA434E861B14D07583173F]]></OBUIAPP_PARAMETER_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <NAME><![CDATA[Table]]></NAME>
+<!--47F7B399D2BA434E861B14D07583173F-->  <DESCRIPTION><![CDATA[A dictionary table used for this tab that points to the database table.]]></DESCRIPTION>
+<!--47F7B399D2BA434E861B14D07583173F-->  <HELP><![CDATA[The Table indicates the table in which a field or fields reside.]]></HELP>
+<!--47F7B399D2BA434E861B14D07583173F-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_REFERENCE_ID><![CDATA[87E6CFF8F71548AFA33F181C317970B5]]></AD_REFERENCE_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_REFERENCE_VALUE_ID><![CDATA[682B6F47F6B147008D0454FEACB9F4C7]]></AD_REFERENCE_VALUE_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <COLUMNNAME><![CDATA[AD_Table_ID]]></COLUMNNAME>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--47F7B399D2BA434E861B14D07583173F-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_ELEMENT_ID><![CDATA[126]]></AD_ELEMENT_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--47F7B399D2BA434E861B14D07583173F-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--47F7B399D2BA434E861B14D07583173F-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--47F7B399D2BA434E861B14D07583173F-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--47F7B399D2BA434E861B14D07583173F-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--47F7B399D2BA434E861B14D07583173F--></OBUIAPP_PARAMETER>
+
 <!--490120F2EB114AB08A8377DC50DCAB55--><OBUIAPP_PARAMETER>
 <!--490120F2EB114AB08A8377DC50DCAB55-->  <OBUIAPP_PARAMETER_ID><![CDATA[490120F2EB114AB08A8377DC50DCAB55]]></OBUIAPP_PARAMETER_ID>
 <!--490120F2EB114AB08A8377DC50DCAB55-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -449,6 +552,33 @@
 <!--608B149396C04375B78B0B28681AA53E-->  <EM_OBKMO_WIDGET_CLASS_ID><![CDATA[7EE694CFF8B94B4C9B9CE69C9D292CC4]]></EM_OBKMO_WIDGET_CLASS_ID>
 <!--608B149396C04375B78B0B28681AA53E--></OBUIAPP_PARAMETER>
 
+<!--630B129C43ED4FDAA4A8F9C518FC413D--><OBUIAPP_PARAMETER>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <OBUIAPP_PARAMETER_ID><![CDATA[630B129C43ED4FDAA4A8F9C518FC413D]]></OBUIAPP_PARAMETER_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <NAME><![CDATA[Organization]]></NAME>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_REFERENCE_VALUE_ID><![CDATA[C205D56B07D74778A6D6A1AED8467690]]></AD_REFERENCE_VALUE_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <COLUMNNAME><![CDATA[AD_Org_ID]]></COLUMNNAME>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <DEFAULTVALUE><![CDATA['0']]></DEFAULTVALUE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_ELEMENT_ID><![CDATA[113]]></AD_ELEMENT_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--630B129C43ED4FDAA4A8F9C518FC413D--></OBUIAPP_PARAMETER>
+
 <!--642AFC2EE03646DBA83C8744F81BA691--><OBUIAPP_PARAMETER>
 <!--642AFC2EE03646DBA83C8744F81BA691-->  <OBUIAPP_PARAMETER_ID><![CDATA[642AFC2EE03646DBA83C8744F81BA691]]></OBUIAPP_PARAMETER_ID>
 <!--642AFC2EE03646DBA83C8744F81BA691-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1074,6 +1204,31 @@
 <!--E22E8E3B737D4A47A691A073951BBF16-->  <C_ATTACHMENT_METHOD_ID><![CDATA[D7B1319FC2B340799283BBF8E838DF9F]]></C_ATTACHMENT_METHOD_ID>
 <!--E22E8E3B737D4A47A691A073951BBF16--></OBUIAPP_PARAMETER>
 
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3--><OBUIAPP_PARAMETER>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <OBUIAPP_PARAMETER_ID><![CDATA[E4AAC9D59BEF4DF4A138D83602D3BEB3]]></OBUIAPP_PARAMETER_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <NAME><![CDATA[Delete existing Accounting Entries]]></NAME>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <DESCRIPTION><![CDATA[The selected accounting entries will be deleted!  DANGEROUS !!!]]></DESCRIPTION>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <HELP><![CDATA[The selected accounting entries will be deleted!  DANGEROUS !!!]]></HELP>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <COLUMNNAME><![CDATA[DeletePosting]]></COLUMNNAME>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_ELEMENT_ID><![CDATA[1692]]></AD_ELEMENT_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3--></OBUIAPP_PARAMETER>
+
 <!--EBAC5A44ECF3491A9B4281C8902A3B02--><OBUIAPP_PARAMETER>
 <!--EBAC5A44ECF3491A9B4281C8902A3B02-->  <OBUIAPP_PARAMETER_ID><![CDATA[EBAC5A44ECF3491A9B4281C8902A3B02]]></OBUIAPP_PARAMETER_ID>
 <!--EBAC5A44ECF3491A9B4281C8902A3B02-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -585,6 +585,26 @@
 <!--C600DAD457664EFDA6B1AA76931552BA-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
 <!--C600DAD457664EFDA6B1AA76931552BA--></OBUIAPP_PROCESS>
 
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC--><OBUIAPP_PROCESS>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <VALUE><![CDATA[Reset Accounting]]></VALUE>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <NAME><![CDATA[Reset Accounting]]></NAME>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <DESCRIPTION><![CDATA[Reset Accounting Entries]]></DESCRIPTION>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <HELP><![CDATA[The reset accounting process allows to totally or partially remove the ledger entries of an organization. The ledger entries can be massively re-created again by using the "Accounting Server Process" or the "G/L Posting by DB Tables" process. The manual changes done for the accounting entries description will obviously be lost after running this process]]></HELP>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <CLASSNAME><![CDATA[org.openbravo.common.actionhandler.ResetAccountingHandler]]></CLASSNAME>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <UIPATTERN><![CDATA[OBUIAPP_PickAndExecute]]></UIPATTERN>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISMULTIRECORD><![CDATA[N]]></ISMULTIRECORD>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISGRIDLEGACY><![CDATA[N]]></ISGRIDLEGACY>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC--></OBUIAPP_PROCESS>
+
 <!--D395B727675C45C98320F8A40E0768E7--><OBUIAPP_PROCESS>
 <!--D395B727675C45C98320F8A40E0768E7-->  <OBUIAPP_PROCESS_ID><![CDATA[D395B727675C45C98320F8A40E0768E7]]></OBUIAPP_PROCESS_ID>
 <!--D395B727675C45C98320F8A40E0768E7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Mon Jun 20 09:04:10 2016 +0200
@@ -68,6 +68,38 @@
 <!--121CCCD7F670457A9FF815163F11A61F-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--121CCCD7F670457A9FF815163F11A61F--></OBUISEL_SELECTOR>
 
+<!--159A0EA5DE8844E9B0E7198E5525C854--><OBUISEL_SELECTOR>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <OBUISEL_SELECTOR_ID><![CDATA[159A0EA5DE8844E9B0E7198E5525C854]]></OBUISEL_SELECTOR_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <NAME><![CDATA[Client Selector]]></NAME>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_REFERENCE_ID><![CDATA[45134B97CEF74E27AD2A5D8E8DC8D388]]></AD_REFERENCE_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_TABLE_ID><![CDATA[112]]></AD_TABLE_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <WHERECLAUSE><![CDATA[e.id=@client@ or e.id='0']]></WHERECLAUSE>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <POPUPTEXTMATCHSTYLE><![CDATA[substring]]></POPUPTEXTMATCHSTYLE>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--159A0EA5DE8844E9B0E7198E5525C854--></OBUISEL_SELECTOR>
+
+<!--1DB80A7D4BC244F0BE5615702D3BF91C--><OBUISEL_SELECTOR>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <OBUISEL_SELECTOR_ID><![CDATA[1DB80A7D4BC244F0BE5615702D3BF91C]]></OBUISEL_SELECTOR_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <NAME><![CDATA[Legal or Business Organizations Selector]]></NAME>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_REFERENCE_ID><![CDATA[C205D56B07D74778A6D6A1AED8467690]]></AD_REFERENCE_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_TABLE_ID><![CDATA[155]]></AD_TABLE_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <WHERECLAUSE><![CDATA[(e.id='0' OR exists (select 1 from OrganizationType ot where ot.id = e.organizationType.id and (ot.legalEntity=true or ot.businessUnit=true))) AND e.ready=true]]></WHERECLAUSE>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <POPUPTEXTMATCHSTYLE><![CDATA[substring]]></POPUPTEXTMATCHSTYLE>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C--></OBUISEL_SELECTOR>
+
 <!--1E14C66616444E0DA8D5C5321EC9F61B--><OBUISEL_SELECTOR>
 <!--1E14C66616444E0DA8D5C5321EC9F61B-->  <OBUISEL_SELECTOR_ID><![CDATA[1E14C66616444E0DA8D5C5321EC9F61B]]></OBUISEL_SELECTOR_ID>
 <!--1E14C66616444E0DA8D5C5321EC9F61B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -620,6 +652,22 @@
 <!--A48B1462EE7F4C109F06564E0B4677A8-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--A48B1462EE7F4C109F06564E0B4677A8--></OBUISEL_SELECTOR>
 
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12--><OBUISEL_SELECTOR>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <OBUISEL_SELECTOR_ID><![CDATA[ACF43EE5C10F4A83ABCDF1C9F55CDB12]]></OBUISEL_SELECTOR_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <NAME><![CDATA[Table Multi Selector]]></NAME>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_REFERENCE_ID><![CDATA[682B6F47F6B147008D0454FEACB9F4C7]]></AD_REFERENCE_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_TABLE_ID><![CDATA[800039]]></AD_TABLE_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <WHERECLAUSE><![CDATA[e.language=@#AD_LANGUAGE@]]></WHERECLAUSE>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <POPUPTEXTMATCHSTYLE><![CDATA[substring]]></POPUPTEXTMATCHSTYLE>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12--></OBUISEL_SELECTOR>
+
 <!--B06B003BD6E34FDDAF5DFD5A9ECD14E2--><OBUISEL_SELECTOR>
 <!--B06B003BD6E34FDDAF5DFD5A9ECD14E2-->  <OBUISEL_SELECTOR_ID><![CDATA[B06B003BD6E34FDDAF5DFD5A9ECD14E2]]></OBUISEL_SELECTOR_ID>
 <!--B06B003BD6E34FDDAF5DFD5A9ECD14E2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-test/src/org/openbravo/test/costing/TestCosting.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-test/src/org/openbravo/test/costing/TestCosting.java	Mon Jun 20 09:04:10 2016 +0200
@@ -10160,6 +10160,7 @@
             productPriceClone.setListPrice(salesPrice);
           }
           productPriceClone.setProduct(productClone);
+          OBDal.getInstance().save(productPriceClone);
           productClone.getPricingProductPriceList().add(productPriceClone);
           i++;
         }
--- a/src-test/src/org/openbravo/test/system/SystemValidatorTest.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src-test/src/org/openbravo/test/system/SystemValidatorTest.java	Mon Jun 20 09:04:10 2016 +0200
@@ -19,7 +19,9 @@
 
 package org.openbravo.test.system;
 
+import static org.hamcrest.Matchers.not;
 import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeThat;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -27,6 +29,7 @@
 import org.apache.log4j.Logger;
 import org.hibernate.Query;
 import org.hibernate.criterion.Restrictions;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -52,7 +55,11 @@
    * Performs module validation using the {@link ModuleValidator}.
    */
   @Test
+  @Ignore("Temporarily ignore test until it can be optionally disabled via some configuration")
   public void testModulesValidation() {
+    String postPublication = System.getProperty("post.publication");
+    assumeThat("Ignoring test case during post publication cycle", postPublication, not("true"));
+
     setSystemAdministratorContext();
     List<String> updatedModules = null;
     try {
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/ResetAccountingAccess.class has changed
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/ResetAccountingAccessData.class has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/ResetAccountingAccess.java	Mon Jun 20 09:04:10 2016 +0200
@@ -0,0 +1,47 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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.modulescript;
+
+import org.openbravo.modulescript.ModuleScript;
+import org.openbravo.database.ConnectionProvider;
+
+/*
+ * Related to issue: https://issues.openbravo.com/view.php?id=33063
+ */
+public class ResetAccountingAccess extends ModuleScript {
+  @Override
+  public void execute() {
+    try {
+      ConnectionProvider cp = getConnectionProvider();
+      ResetAccountingAccessData.insert(cp);
+    } catch(Exception e) {
+      handleError(e);
+    }
+  }
+
+  @Override
+  protected ModuleScriptExecutionLimits getModuleScriptExecutionLimits() {
+    return new ModuleScriptExecutionLimits("0", null, new OpenbravoVersion(3,0,28839));
+  }
+
+  @Override
+  protected boolean executeOnInstall() {
+    return false;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/ResetAccountingAccess_data.xsql	Mon Jun 20 09:04:10 2016 +0200
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<SqlClass name="ResetAccountingAccessData" package="org.openbravo.modulescript">
+  <SqlClassComment></SqlClassComment>
+  <SqlMethod name="select" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT '' as exist FROM DUAL
+      ]]>
+    </Sql>
+  </SqlMethod>
+  <SqlMethod name="insert" type="preparedStatement" return="rowcount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        INSERT INTO OBUIAPP_Process_Access
+        (
+          OBUIAPP_Process_Access_ID, OBUIAPP_Process_ID, AD_Role_ID, AD_Client_ID,
+          AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy
+        )
+        SELECT
+          get_uuid(), 'C6ED4B93E0D54C08A57072AEEC40E6EC', ad_role_id, ad_client_id,
+          ad_org_id, isactive, to_date(now()), '0', to_date(now()), '0'
+        FROM AD_Process_Access apa
+        WHERE ad_process_id = 'E264309FF8244A94936502BF51829109'
+        AND NOT EXISTS (
+          SELECT 1
+          FROM OBUIAPP_Process_Access opa
+          WHERE opa.ad_role_id = apa.ad_role_id
+          AND opa.obuiapp_process_id = 'C6ED4B93E0D54C08A57072AEEC40E6EC'
+        )
+      ]]>
+    </Sql>
+  </SqlMethod>
+</SqlClass>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/common/actionhandler/ResetAccountingHandler.java	Mon Jun 20 09:04:10 2016 +0200
@@ -0,0 +1,98 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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.common.actionhandler;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.client.application.process.BaseProcessActionHandler;
+import org.openbravo.erpCommon.utility.OBDateUtils;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.financial.ResetAccounting;
+import org.openbravo.service.db.DbUtility;
+import org.openbravo.service.json.JsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ResetAccountingHandler extends BaseProcessActionHandler {
+
+  private static final Logger log = LoggerFactory.getLogger(ResetAccountingHandler.class);
+
+  @Override
+  protected JSONObject doExecute(Map<String, Object> parameters, String content) {
+
+    JSONObject result = null;
+    try {
+      result = new JSONObject();
+      JSONObject request = new JSONObject(content);
+      JSONObject params = request.getJSONObject("_params");
+
+      String adClientId = params.getString("AD_Client_ID");
+      String adOrgId = params.getString("AD_Org_ID");
+      String deletePosting = params.getString("DeletePosting");
+      String datefrom = StringUtils.equals(params.getString("datefrom"), "null") ? "" : OBDateUtils
+          .formatDate(JsonUtils.createDateFormat().parse(params.getString("datefrom")));
+      String dateto = StringUtils.equals(params.getString("dateto"), "null") ? "" : OBDateUtils
+          .formatDate(JsonUtils.createDateFormat().parse(params.getString("dateto")));
+      JSONArray tableIds = params.getJSONArray("AD_Table_ID");
+      List<String> tableIdsList = new ArrayList<String>();
+      for (int i = 0; i < tableIds.length(); i++) {
+        String tableId = tableIds.getString(i);
+        tableIdsList.add(tableId);
+      }
+
+      HashMap<String, Integer> results = new HashMap<String, Integer>();
+      if (StringUtils.equals(deletePosting, "true")) {
+        results = ResetAccounting.delete(adClientId, adOrgId, tableIdsList, datefrom, dateto);
+      } else {
+        results = ResetAccounting.restore(adClientId, adOrgId, tableIdsList, datefrom, dateto);
+      }
+
+      int counter = results.get("updated");
+      int counterDeleted = results.get("deleted");
+      JSONObject successMessage = new JSONObject();
+      successMessage.put("severity", "success");
+      StringBuilder message = new StringBuilder();
+      message.append(OBMessageUtils.parseTranslation("@UnpostedDocuments@ = " + counter
+          + ", @DeletedEntries@ = " + counterDeleted));
+      successMessage.put("text", message);
+      result.put("message", successMessage);
+
+    } catch (Exception e) {
+      log.error("Error in Reset Accounting Action Handler", e);
+      try {
+        result = new JSONObject();
+        Throwable ex = DbUtility.getUnderlyingSQLException(e);
+        String message = OBMessageUtils.translateError(ex.getMessage()).getMessage();
+        JSONObject errorMessage = new JSONObject();
+        errorMessage.put("severity", "error");
+        errorMessage.put("text", message);
+        result.put("message", errorMessage);
+      } catch (Exception e2) {
+        log.error(e.getMessage(), e2);
+      }
+    }
+    return result;
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/common/datasource/ReturnFromCustomerVendorPropertyFieldsTransformer.java	Mon Jun 20 09:04:10 2016 +0200
@@ -0,0 +1,75 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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.common.datasource;
+
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.criterion.Restrictions;
+import org.openbravo.client.kernel.ComponentProvider;
+import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.service.OBCriteria;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.ad.ui.Field;
+import org.openbravo.model.ad.ui.Tab;
+import org.openbravo.service.datasource.HQLDataSourceService;
+import org.openbravo.service.json.JsonConstants;
+
+/**
+ * Transformer to enable Property Fields in Return to Customer and Return to Vendor P&E grids
+ */
+@ComponentProvider.Qualifier("CDB9DC9655F24DF8AB41AA0ADBD04390")
+public class ReturnFromCustomerVendorPropertyFieldsTransformer extends
+    ReturnToFromCustomerVendorHQLTransformer {
+  private static final String COMMA = ",";
+
+  @Override
+  public int getPriority(Map<String, String> parameters) {
+    return 90;
+  }
+
+  @Override
+  public String transformHqlQuery(String hqlQuery, Map<String, String> requestParameters,
+      Map<String, Object> queryNamedParameters) {
+    String modifiedQuery = hqlQuery;
+    if (requestParameters.containsKey(JsonConstants.ADDITIONAL_PROPERTIES_PARAMETER)) {
+      String extraProperties = requestParameters.get(JsonConstants.ADDITIONAL_PROPERTIES_PARAMETER);
+      String[] properties = extraProperties.split(COMMA);
+      if (properties.length > 0) {
+        String tabId = requestParameters.get(JsonConstants.TAB_PARAMETER);
+        Tab currentTab = OBDal.getInstance().getProxy(Tab.class, tabId);
+        OBCriteria<Field> obCriteria = OBDal.getInstance().createCriteria(Field.class);
+        obCriteria.add(Restrictions.eq(Field.PROPERTY_TAB, currentTab));
+        obCriteria.add(Restrictions.isNotNull(Field.PROPERTY_PROPERTY));
+        List<Field> propertyFieldList = obCriteria.list();
+
+        for (Field field : propertyFieldList) {
+          String propertyName = field.getProperty();
+          if (extraProperties.contains(propertyName)) {
+            modifiedQuery = modifiedQuery.replace("MAINFROM", ", iol." + propertyName + " as "
+                + propertyName.replace(DalUtil.DOT, HQLDataSourceService.PROPERTY_FIELD_SEPARATOR)
+                + " MAINFROM");
+          }
+        }
+      }
+    }
+    return super.transformHqlQuery(modifiedQuery, requestParameters, queryNamedParameters);
+  }
+}
\ No newline at end of file
--- a/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Mon Jun 20 09:04:10 2016 +0200
@@ -150,20 +150,7 @@
 
   private List<Map<String, Object>> getOrderLineSetValueFilterData(Map<String, String> parameters) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-    Map<String, String> filterCriteria = new HashMap<String, String>();
-    try {
-      // Builds the criteria based on the fetch parameters
-      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
-      for (int i = 0; i < criterias.length(); i++) {
-        final JSONObject criteria = criterias.getJSONObject(i);
-        if (criteria.has("fieldName")) {
-          filterCriteria.put(criteria.getString("fieldName"),
-              criteria.has("value") ? criteria.getString("value") : criteria.toString());
-        }
-      }
-    } catch (JSONException e) {
-      log4j.error("Error while building the criteria", e);
-    }
+    Map<String, String> filterCriteria = buildCriteria(parameters);
     OBContext.setAdminMode();
     try {
       for (OrderLine o : getOrderLineFromGrid(filterCriteria.get("orderLine$_identifier"),
@@ -206,18 +193,7 @@
 
   private List<Map<String, Object>> getWarehouseFilterData(Map<String, String> parameters) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-    Map<String, String> filterCriteria = new HashMap<String, String>();
-    try {
-      // Builds the criteria based on the fetch parameters
-      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
-      for (int i = 0; i < criterias.length(); i++) {
-        final JSONObject criteria = criterias.getJSONObject(i);
-        filterCriteria.put(criteria.getString("fieldName"),
-            criteria.has("value") ? criteria.getString("value") : criteria.toString());
-      }
-    } catch (JSONException e) {
-      log4j.error("Error while building the criteria", e);
-    }
+    Map<String, String> filterCriteria = buildCriteria(parameters);
     OBContext.setAdminMode();
     try {
       for (Warehouse o : getWarehouseFromGrid(filterCriteria.get("warehouse$_identifier"),
@@ -342,18 +318,7 @@
 
   private List<Map<String, Object>> getStorageFilterData(Map<String, String> parameters) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-    Map<String, String> filterCriteria = new HashMap<String, String>();
-    try {
-      // Builds the criteria based on the fetch parameters
-      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
-      for (int i = 0; i < criterias.length(); i++) {
-        final JSONObject criteria = criterias.getJSONObject(i);
-        filterCriteria.put(criteria.getString("fieldName"),
-            criteria.has("value") ? criteria.getString("value") : criteria.toString());
-      }
-    } catch (JSONException e) {
-      log4j.error("Error while building the criteria", e);
-    }
+    Map<String, String> filterCriteria = buildCriteria(parameters);
     OBContext.setAdminMode();
     try {
       for (Locator o : getStorageBinFromGrid(filterCriteria.get("storageBin$_identifier"),
@@ -462,20 +427,7 @@
 
   private List<Map<String, Object>> getAttributeSetValueFilterData(Map<String, String> parameters) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-    Map<String, String> filterCriteria = new HashMap<String, String>();
-    try {
-      // Builds the criteria based on the fetch parameters
-      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
-      for (int i = 0; i < criterias.length(); i++) {
-        final JSONObject criteria = criterias.getJSONObject(i);
-        if (criteria.has("fieldName")) {
-          filterCriteria.put(criteria.getString("fieldName"),
-              criteria.has("value") ? criteria.getString("value") : criteria.toString());
-        }
-      }
-    } catch (JSONException e) {
-      log4j.error("Error while building the criteria", e);
-    }
+    Map<String, String> filterCriteria = buildCriteria(parameters);
     OBContext.setAdminMode();
     try {
       for (AttributeSetInstance o : getAttributeSetValueFromGrid(
@@ -531,14 +483,33 @@
         if (criteria.has("criteria") && criteria.has("operator")) {
           JSONArray mySon = new JSONArray(criteria.getString("criteria"));
           for (int j = 0; j < mySon.length(); j++) {
-            if (filterCriteria.containsKey(mySon.getJSONObject(j).getString("fieldName"))) {
-              JSONArray values = new JSONArray(filterCriteria.get(mySon.getJSONObject(j).getString(
-                  "fieldName")));
-              filterCriteria.put(mySon.getJSONObject(j).getString("fieldName"),
-                  values.put(mySon.getJSONObject(j)).toString());
-            } else {
-              filterCriteria.put(mySon.getJSONObject(j).getString("fieldName"), new JSONArray()
-                  .put(mySon.getJSONObject(j)).toString());
+            final JSONObject criteria2 = mySon.getJSONObject(j);
+            if (criteria2.has("criteria") && criteria2.has("operator")) {
+              JSONArray mySonSon = new JSONArray(criteria2.getString("criteria"));
+              for (int k = 0; k < mySonSon.length(); k++) {
+                final JSONObject criteria3 = mySonSon.getJSONObject(k);
+                if (criteria3.has("fieldName")) {
+                  if (filterCriteria.containsKey(criteria3.getString("fieldName"))) {
+                    JSONArray values = new JSONArray(filterCriteria.get(criteria3
+                        .getString("fieldName")));
+                    filterCriteria.put(criteria3.getString("fieldName"), values.put(criteria3)
+                        .toString());
+                  } else {
+                    filterCriteria.put(criteria3.getString("fieldName"),
+                        new JSONArray().put(criteria3).toString());
+                  }
+                }
+              }
+            } else if (criteria2.has("fieldName")) {
+              if (filterCriteria.containsKey(criteria2.getString("fieldName"))) {
+                JSONArray values = new JSONArray(filterCriteria.get(criteria2
+                    .getString("fieldName")));
+                filterCriteria.put(criteria2.getString("fieldName"), values.put(criteria2)
+                    .toString());
+              } else {
+                filterCriteria.put(criteria2.getString("fieldName"), new JSONArray().put(criteria2)
+                    .toString());
+              }
             }
           }
           // lessOrEqual
@@ -1657,6 +1628,44 @@
     return (BigDecimal) query.uniqueResult();
   }
 
+  private Map<String, String> buildCriteria(Map<String, String> parameters) {
+    Map<String, String> filterCriteria = new HashMap<String, String>();
+
+    try {
+      // Builds the criteria based on the fetch parameters
+      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
+      for (int i = 0; i < criterias.length(); i++) {
+        final JSONObject criteria1 = criterias.getJSONObject(i);
+        if (criteria1.has("criteria") && criteria1.has("operator")) {
+          JSONArray mySon = new JSONArray(criteria1.getString("criteria"));
+          for (int j = 0; j < mySon.length(); j++) {
+            final JSONObject criteria2 = mySon.getJSONObject(j);
+            if (criteria2.has("criteria") && criteria2.has("operator")) {
+              JSONArray mySonSon = new JSONArray(criteria2.getString("criteria"));
+              for (int k = 0; k < mySonSon.length(); k++) {
+                final JSONObject criteria3 = mySonSon.getJSONObject(k);
+                if (criteria3.has("fieldName")) {
+                  filterCriteria.put(criteria3.getString("fieldName"),
+                      criteria3.has("value") ? criteria3.getString("value") : criteria3.toString());
+                }
+              }
+            } else if (criteria2.has("fieldName")) {
+              filterCriteria.put(criteria2.getString("fieldName"),
+                  criteria2.has("value") ? criteria2.getString("value") : criteria2.toString());
+            }
+          }
+        } else if (criteria1.has("fieldName")) {
+          filterCriteria.put(criteria1.getString("fieldName"),
+              criteria1.has("value") ? criteria1.getString("value") : criteria1.toString());
+        }
+      }
+    } catch (JSONException e) {
+      log4j.error("Error while building the criteria", e);
+    }
+
+    return filterCriteria;
+  }
+
   @Override
   protected int getCount(Map<String, String> parameters) {
     // TODO Auto-generated method stub
--- a/src/org/openbravo/costing/CostAdjustmentUtils.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/costing/CostAdjustmentUtils.java	Mon Jun 20 09:04:10 2016 +0200
@@ -174,7 +174,8 @@
     where.append("   and trx." + MaterialTransaction.PROPERTY_MOVEMENTQUANTITY + " >= :trxqty");
     where.append(" ))");
 
-    where.append("   and trx." + MaterialTransaction.PROPERTY_MOVEMENTDATE + " > :movementDate");
+    where.append(
+        "   and trunc(trx." + MaterialTransaction.PROPERTY_MOVEMENTDATE + ") > :movementDate");
     where.append("   and trx." + MaterialTransaction.PROPERTY_PRODUCT + ".id = :productId");
     where.append("   and trx." + MaterialTransaction.PROPERTY_ORGANIZATION + ".id in (:orgs)");
 
--- a/src/org/openbravo/costing/LandedCostDistributionByAmount.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/costing/LandedCostDistributionByAmount.java	Mon Jun 20 09:04:10 2016 +0200
@@ -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-2015 Openbravo SLU
+ * All portions are Copyright (C) 2014-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -76,7 +76,7 @@
           trxAmt = getConvertedAmount(trxAmt, strTrxCur, strCurId, dateReference, strOrgId);
         }
 
-        totalAmt = totalAmt.add(trxAmt);
+        totalAmt = totalAmt.add(trxAmt.abs());
 
         if (i % 100 == 0) {
           OBDal.getInstance().flush();
@@ -107,7 +107,10 @@
         // Insert pending amount on receipt with higher cost to avoid rounding issues.
         receiptAmt = pendingAmt;
       } else {
-        receiptAmt = baseAmt.multiply(trxAmt).divide(totalAmt, precission, RoundingMode.HALF_UP);
+        receiptAmt = baseAmt.multiply(trxAmt.abs());
+        if (totalAmt.compareTo(BigDecimal.ZERO) != 0) {
+          receiptAmt = receiptAmt.divide(totalAmt, precission, RoundingMode.HALF_UP);
+        }
       }
       pendingAmt = pendingAmt.subtract(receiptAmt);
       LCReceipt lcrl = (LCReceipt) OBDal.getInstance().getProxy(LCReceipt.ENTITY_NAME,
--- a/src/org/openbravo/dal/core/OBContext.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/dal/core/OBContext.java	Mon Jun 20 09:04:10 2016 +0200
@@ -546,7 +546,7 @@
   private Language language;
   private boolean translationInstalled;
   private Warehouse warehouse;
-  private List<Organization> organizationList;
+  private List<String> organizationList;
   private String[] readableOrganizations;
   private String[] readableClients;
   private Set<String> writableOrganizations;
@@ -613,9 +613,9 @@
       writableOrganizations.add("0");
     }
 
-    final List<Organization> os = getOrganizationList(role);
-    for (final Organization o : os) {
-      writableOrganizations.add(o.getId());
+    final List<String> os = getOrganizationList(role);
+    for (final String o : os) {
+      writableOrganizations.add(o);
     }
 
     if (localUserLevel.equals("O")) { // remove *
@@ -625,31 +625,30 @@
   }
 
   @SuppressWarnings("unchecked")
-  private List<Organization> getOrganizationList(Role thisRole) {
+  private List<String> getOrganizationList(Role thisRole) {
     if (organizationList != null) {
-      return new ArrayList<Organization>(organizationList);
+      return new ArrayList<String>(organizationList);
     }
     final Query qry = SessionHandler.getInstance().createQuery(
-        "select o from " + Organization.class.getName() + " o, " + RoleOrganization.class.getName()
-            + " roa where o." + Organization.PROPERTY_ID + "=roa."
-            + RoleOrganization.PROPERTY_ORGANIZATION + "." + Organization.PROPERTY_ID + " and roa."
-            + RoleOrganization.PROPERTY_ROLE + "." + Organization.PROPERTY_ID + "='"
+        "select o.id from " + Organization.class.getName() + " o, "
+            + RoleOrganization.class.getName() + " roa where o." + Organization.PROPERTY_ID
+            + "=roa." + RoleOrganization.PROPERTY_ORGANIZATION + "." + Organization.PROPERTY_ID
+            + " and roa." + RoleOrganization.PROPERTY_ROLE + "." + Organization.PROPERTY_ID + "='"
             + thisRole.getId() + "' and roa." + RoleOrganization.PROPERTY_ACTIVE + "='Y' and o."
             + Organization.PROPERTY_ACTIVE + "='Y'");
     organizationList = qry.list();
     for (final String orgId : additionalWritableOrganizations) {
-      final Organization org = OBDal.getInstance().get(Organization.class, orgId);
-      if (!organizationList.contains(org)) {
-        organizationList.add(org);
+      if (!organizationList.contains(orgId)) {
+        organizationList.add(orgId);
       }
     }
-    return new ArrayList<Organization>(organizationList);
+    return new ArrayList<String>(organizationList);
   }
 
   @SuppressWarnings("unchecked")
-  private List<Organization> getOrganizations(Client client) {
+  private List<String> getOrganizations(Client client) {
     final Query qry = SessionHandler.getInstance().createQuery(
-        "select o from " + Organization.class.getName() + " o where " + "o."
+        "select o.id from " + Organization.class.getName() + " o where " + "o."
             + Organization.PROPERTY_CLIENT + "=? and o." + Organization.PROPERTY_ACTIVE + "='Y'");
     qry.setParameter(0, client);
     organizationList = qry.list();
@@ -657,14 +656,14 @@
   }
 
   private void setReadableOrganizations(Role role) {
-    final List<Organization> os = getOrganizationList(role);
+    final List<String> os = getOrganizationList(role);
     final Set<String> readableOrgs = new HashSet<String>();
-    for (final Organization o : os) {
-      readableOrgs.addAll(getOrganizationStructureProvider().getNaturalTree(o.getId()));
+    for (final String o : os) {
+      readableOrgs.addAll(getOrganizationStructureProvider().getNaturalTree(o));
       // if zero is an organization then add them all!
-      if (o.getId().equals("0")) {
-        for (final Organization org : getOrganizations(getCurrentClient())) {
-          readableOrgs.add(org.getId());
+      if (o.equals("0")) {
+        for (final String org : getOrganizations(getCurrentClient())) {
+          readableOrgs.add(org);
         }
       }
     }
--- a/src/org/openbravo/dal/security/OrganizationStructureProvider.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/dal/security/OrganizationStructureProvider.java	Mon Jun 20 09:04:10 2016 +0200
@@ -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-2014 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -77,25 +77,27 @@
     }
 
     // read all trees of all clients, bypass DAL to prevent security checks
-    final String qryStr = "select t from " + Tree.class.getName() + " t where table.id='"
+    final String qryStr = "select t.id from " + Tree.class.getName() + " t where table.id='"
         + AD_ORG_TABLE_ID + "' and client.id='" + getClientId() + "'";
     final Query qry = SessionHandler.getInstance().createQuery(qryStr);
     @SuppressWarnings("unchecked")
-    final List<Tree> ts = qry.list();
-    final List<TreeNode> treeNodes = new ArrayList<TreeNode>();
-    for (final Tree t : ts) {
-      final String nodeQryStr = "select tn from " + TreeNode.class.getName()
-          + " tn where tn.tree.id='" + t.getId() + "'";
+    final List<String> ts = qry.list();
+    final List<Object[]> treeNodes = new ArrayList<Object[]>();
+    for (final String treeId : ts) {
+      final String nodeQryStr = "select tn.node, tn.reportSet from " + TreeNode.class.getName()
+          + " tn where tn.tree.id='" + treeId + "'";
       final Query nodeQry = SessionHandler.getInstance().createQuery(nodeQryStr);
       @SuppressWarnings("unchecked")
-      final List<TreeNode> tns = nodeQry.list();
+      final List<Object[]> tns = nodeQry.list();
       treeNodes.addAll(tns);
     }
 
     final List<OrgNode> orgNodes = new ArrayList<OrgNode>(treeNodes.size());
-    for (final TreeNode tn : treeNodes) {
+    for (final Object[] tn : treeNodes) {
       final OrgNode on = new OrgNode();
-      on.setTreeNode(tn);
+      String nodeId = (String) tn[0];
+      String parentId = (String) tn[1];
+      on.setTreeNodeData(nodeId, parentId);
       orgNodes.add(on);
     }
 
@@ -105,18 +107,17 @@
 
     for (final OrgNode on : orgNodes) {
       if (on.getParent() != null) {
-        parentByOrganizationID.put(on.getTreeNode().getNode(), on.getParent().getTreeNode()
-            .getNode());
+        parentByOrganizationID.put(on.getNodeId(), on.getParent().getNodeId());
       }
     }
 
     for (final OrgNode on : orgNodes) {
-      naturalTreesByOrgID.put(on.getTreeNode().getNode(), on.getNaturalTree());
+      naturalTreesByOrgID.put(on.getNodeId(), on.getNaturalTree());
       if (on.getChildren() != null) {
         Set<String> os = new HashSet<String>();
         for (OrgNode o : on.getChildren())
-          os.add(o.getTreeNode().getNode());
-        childByOrganizationID.put(on.getTreeNode().getNode(), os);
+          os.add(o.getNodeId());
+        childByOrganizationID.put(on.getNodeId(), os);
       }
     }
     isInitialized = true;
@@ -293,7 +294,8 @@
 
   class OrgNode {
 
-    private TreeNode treeNode;
+    private String nodeId;
+    private String parentNodeId;
     private OrgNode parent;
     private List<OrgNode> children = new ArrayList<OrgNode>();
 
@@ -306,11 +308,11 @@
     }
 
     public void resolve(List<OrgNode> nodes) {
-      if (treeNode.getReportSet() == null) {
+      if (parentNodeId == null) {
         return;
       }
       for (final OrgNode on : nodes) {
-        if (on.getTreeNode().getNode().equals(treeNode.getReportSet())) {
+        if (on.getNodeId().equals(parentNodeId)) {
           on.addChild(this);
           setParent(on);
           break;
@@ -321,7 +323,7 @@
     public Set<String> getNaturalTree() {
       if (naturalTree == null) {
         naturalTree = new HashSet<String>();
-        naturalTree.add(getTreeNode().getNode());
+        naturalTree.add(getNodeId());
         if (getParent() != null) {
           getParent().getParentPath(naturalTree);
         }
@@ -335,7 +337,7 @@
     public void getParentPath(Set<String> theNaturalTree) {
       if (naturalTreeParent == null) {
         naturalTreeParent = new HashSet<String>();
-        naturalTreeParent.add(getTreeNode().getNode());
+        naturalTreeParent.add(getNodeId());
         if (getParent() != null) {
           getParent().getParentPath(naturalTreeParent);
         }
@@ -346,7 +348,7 @@
     public void getChildPath(Set<String> theNaturalTree) {
       if (naturalTreeChildren == null) {
         naturalTreeChildren = new HashSet<String>();
-        naturalTreeChildren.add(getTreeNode().getNode());
+        naturalTreeChildren.add(getNodeId());
         for (final OrgNode child : getChildren()) {
           child.getChildPath(naturalTreeChildren);
         }
@@ -354,12 +356,17 @@
       theNaturalTree.addAll(naturalTreeChildren);
     }
 
-    public TreeNode getTreeNode() {
-      return treeNode;
+    public String getNodeId() {
+      return nodeId;
     }
 
-    public void setTreeNode(TreeNode treeNode) {
-      this.treeNode = treeNode;
+    public String getParentNodeId() {
+      return parentNodeId;
+    }
+
+    public void setTreeNodeData(String nodeId, String parentNodeId) {
+      this.nodeId = nodeId;
+      this.parentNodeId = parentNodeId;
     }
 
     public OrgNode getParent() {
--- a/src/org/openbravo/dal/security/SecurityChecker.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/dal/security/SecurityChecker.java	Mon Jun 20 09:04:10 2016 +0200
@@ -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-2015 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -33,6 +33,8 @@
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.core.SessionHandler;
+import org.openbravo.model.ad.system.Client;
+import org.openbravo.model.common.enterprise.Organization;
 
 /**
  * This class combines all security checks which are performed on entity level:
@@ -83,51 +85,9 @@
    * @return true if writable, false otherwise
    * @see Entity
    */
-  // NOTE: this method needs to be kept insync with the checkWritable method
   public boolean isWritable(Object obj) {
-
-    // check that the client id and organization id are resp. in the list of
-    // user_client and user_org
-    // TODO: throw specific and translated exception, for more info:
-    // Utility.translateError(this, vars, vars.getLanguage(),
-    // Utility.messageBD(this, "NoWriteAccess", vars.getLanguage()))
-
-    final OBContext obContext = OBContext.getOBContext();
-
-    String clientId = "";
-    if (obj instanceof ClientEnabled && ((ClientEnabled) obj).getClient() != null) {
-      clientId = (String) DalUtil.getId(((ClientEnabled) obj).getClient());
-    }
-    String orgId = "";
-    if (obj instanceof OrganizationEnabled && ((OrganizationEnabled) obj).getOrganization() != null) {
-      orgId = (String) DalUtil.getId(((OrganizationEnabled) obj).getOrganization());
-    }
-
-    final Entity entity = ((BaseOBObject) obj).getEntity();
-    if (!obContext.isInAdministratorMode() && clientId.length() > 0) {
-      if (obj instanceof ClientEnabled) {
-        if (!obContext.getCurrentClient().getId().equals(clientId)) {
-          return false;
-        }
-      }
-
-      // todo can be improved by only checking if the client or
-      // organization
-      // actually changed...
-      if (!obContext.getEntityAccessChecker().isWritable(entity)) {
-        return false;
-      }
-
-      if (obj instanceof OrganizationEnabled && orgId.length() > 0) {
-        if (!obContext.getWritableOrganizations().contains(orgId)) {
-          return false;
-        }
-      }
-    }
-
-    // accesslevel check must also be done for administrators
     try {
-      entity.checkAccessLevel(clientId, orgId);
+      checkWriteAccess(obj, false);
     } catch (final OBSecurityException e) {
       return false;
     }
@@ -142,8 +102,11 @@
    *          the object to check
    * @throws OBSecurityException
    */
-  // NOTE: this method needs to be kept insync with the isWritable method
   public void checkWriteAccess(Object obj) {
+    checkWriteAccess(obj, true);
+  }
+
+  private void checkWriteAccess(Object obj, boolean logError) {
 
     // check that the client id and organization id are resp. in the list of
     // user_client and user_org
@@ -155,10 +118,15 @@
     String clientId = "";
     if (obj instanceof ClientEnabled && ((ClientEnabled) obj).getClient() != null) {
       clientId = (String) DalUtil.getId(((ClientEnabled) obj).getClient());
+    } else if (obj instanceof Client) {
+      clientId = (String) DalUtil.getId(obj);
     }
+
     String orgId = "";
     if (obj instanceof OrganizationEnabled && ((OrganizationEnabled) obj).getOrganization() != null) {
       orgId = (String) DalUtil.getId(((OrganizationEnabled) obj).getOrganization());
+    } else if (obj instanceof Organization) {
+      orgId = (String) DalUtil.getId(obj);
     }
 
     final Entity entity = ((BaseOBObject) obj).getEntity();
@@ -169,21 +137,16 @@
           // TODO: maybe move rollback to exception throwing
           SessionHandler.getInstance().setDoRollback(true);
           throw new OBSecurityException("Client (" + clientId + ") of object (" + obj
-              + ") is not present in ClientList " + obContext.getCurrentClient().getId());
+              + ") is not present in ClientList " + obContext.getCurrentClient().getId(), logError);
         }
       }
 
-      // todo can be improved by only checking if the client or
-      // organization
-      // actually changed...
-      obContext.getEntityAccessChecker().checkWritable(entity);
+      if (!obContext.getEntityAccessChecker().isWritable(entity)) {
+        throw new OBSecurityException("Entity " + entity + " is not writable by this user",
+            logError);
+      }
 
-      if (obj instanceof OrganizationEnabled && orgId != null && orgId.length() > 0) {
-        // todo as only the id is required this can be made much more
-        // efficient
-        // by
-        // not loading the hibernate proxy
-
+      if (orgId != null && orgId.length() > 0) {
         // Due to issue 23419: Impossible to add an organization to one role, it has been necessary
         // to add the below check. The system is going to check if it can avoid the permission
         // during the record insertion. The application is allowed to avoid the permission when the
@@ -197,7 +160,8 @@
           // TODO: maybe move rollback to exception throwing
           SessionHandler.getInstance().setDoRollback(true);
           throw new OBSecurityException("Organization " + orgId + " of object (" + obj
-              + ") is not present in OrganizationList " + obContext.getWritableOrganizations());
+              + ") is not present in OrganizationList " + obContext.getWritableOrganizations(),
+              logError);
         }
       }
     }
--- a/src/org/openbravo/dal/service/OBCriteria.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/dal/service/OBCriteria.java	Mon Jun 20 09:04:10 2016 +0200
@@ -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-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -68,6 +68,7 @@
   private boolean filterOnReadableOrganization = true;
   private boolean filterOnActive = true;
   private List<OrderBy> orderBys = new ArrayList<OrderBy>();
+  private boolean initialized = false;
 
   // package visible
 
@@ -130,6 +131,9 @@
   }
 
   void initialize() {
+    if (initialized) {
+      return;
+    }
     final OBContext obContext = OBContext.getOBContext();
     final Entity e = getEntity();
 
@@ -174,6 +178,7 @@
     if (SessionInfo.getQueryProfile() != null) {
       QueryTimeOutUtil.getInstance().setQueryTimeOut(this, SessionInfo.getQueryProfile());
     }
+    initialized = true;
   }
 
   /**
--- a/src/org/openbravo/erpCommon/ad_process/ResetAccountingProcess.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ResetAccountingProcess.java	Mon Jun 20 09:04:10 2016 +0200
@@ -11,15 +11,18 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
  */
 package org.openbravo.erpCommon.ad_process;
 
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.Utility;
@@ -28,6 +31,12 @@
 import org.openbravo.service.db.DalBaseProcess;
 import org.quartz.JobExecutionException;
 
+/**
+ * 
+ * @deprecated use {@link org.openbravo.common.actionhandler.ResetAccountingHandler}
+ * 
+ */
+@Deprecated
 public class ResetAccountingProcess extends DalBaseProcess {
 
   public void doExecute(ProcessBundle bundle) throws Exception {
@@ -44,11 +53,8 @@
         results = ResetAccounting
             .delete(adClientId, adOrgId, adTableId, recordId, datefrom, dateto);
       } else {
-        if (!"".equals(adTableId)) {
-          results = ResetAccounting.restore(adClientId, adOrgId, adTableId, datefrom, dateto);
-        } else {
-          results = ResetAccounting.restore(adClientId, adOrgId, datefrom, dateto);
-        }
+        List<String> tableIds = StringUtils.isEmpty(adTableId) ? null : Arrays.asList(adTableId);
+        results = ResetAccounting.restore(adClientId, adOrgId, tableIds, datefrom, dateto);
       }
       int counter = results.get("updated");
       int counterDeleted = results.get("deleted");
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html	Mon Jun 20 09:04:10 2016 +0200
@@ -151,13 +151,10 @@
         try {
             if (XMLHttpRequestObj.responseText) {
                 strText = XMLHttpRequestObj.responseText;
-                if (strText && document.getElementById('inpcAcctSchemaId').value != strText) {
+                if (strText) {
                     document.getElementById('inpcAcctSchemaId').value = strText;
                     refreshComboReports();
                 }
-                else {
-                    refreshComboYears();
-                }
             }
        } catch (e) {
        }
@@ -395,7 +392,7 @@
 
                 <tr>
                   <td class="TitleCell"><span class="LabelText">Organization</span></td>
-                  <td class="Combo_ContentCell" colspan="2"> <select name="inpOrganizacion" id="inpOrganizacion" class="ComboKey Combo_TwoCells_width" onchange="setDefaultLedger(); logChanges(this); return true;">
+                  <td class="Combo_ContentCell" colspan="2"> <select name="inpOrganizacion" id="inpOrganizacion" class="ComboKey Combo_TwoCells_width" onchange="refreshComboYears(); logChanges(this); return true;">
                       <option value=""></option><div id="reportC_Org_ID"></div>
                     </select></td>
                 </tr>
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql	Mon Jun 20 09:04:10 2016 +0200
@@ -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-2015 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -153,8 +153,8 @@
         AND AD_ISORGINCLUDED(O.AD_ORG_ID, S.AD_ORG_ID, S.AD_CLIENT_ID) <> -1
         AND AD_ISORGINCLUDED(O.AD_ORG_ID, R.AD_ORG_ID, R.AD_CLIENT_ID) <> -1
         AND S.AD_CLIENT_ID = ?
-        AND (R.ISORGBALANCED <> 'N' OR COALESCE(R.REPORTTYPE,'N') <> 'N')
-        AND O.BALANCED = 'Y' 
+        AND R.ISORGBALANCED = 'Y'
+        AND O.BALANCED = 'Y'
         AND AD_ISORGINCLUDED(O.AD_ORG_ID, ORG.AD_ORG_ID, S.AD_CLIENT_ID) <> -1
         AND ORG.AD_ORG_ID <> '0'
         AND ORG.AD_ORG_ID IN ('1')
@@ -174,7 +174,6 @@
         OR AD_ISORGINCLUDED(R.AD_ORG_ID, O.AD_ORG_ID, R.AD_CLIENT_ID) <> -1)
         AND S.AD_CLIENT_ID = ?
         AND R.ISORGBALANCED = 'N' 
-        AND COALESCE(R.REPORTTYPE,'N') = 'N'
         AND O.AD_ORG_ID IN ('1')
       ORDER BY NAME,PADRE
         ]]></Sql>
--- a/src/org/openbravo/financial/ResetAccounting.java	Fri Jun 17 12:55:17 2016 +0200
+++ b/src/org/openbravo/financial/ResetAccounting.java	Mon Jun 20 09:04:10 2016 +0200
@@ -27,6 +27,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.hibernate.Query;
 import org.hibernate.ScrollMode;
@@ -42,6 +44,7 @@
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.common.enterprise.Organization;
+import org.openbravo.model.common.enterprise.OrganizationType;
 import org.openbravo.model.financialmgmt.accounting.AccountingFact;
 import org.openbravo.model.financialmgmt.calendar.Period;
 
@@ -49,6 +52,24 @@
   final static int FETCH_SIZE = 1000;
   private static final Logger log4j = Logger.getLogger(ResetAccounting.class);
 
+  public static HashMap<String, Integer> delete(String adClientId, String adOrgId,
+      List<String> tableIds, String strdatefrom, String strdateto) throws OBException {
+    if (tableIds.isEmpty()) {
+      return delete(adClientId, adOrgId, "", null, strdatefrom, strdateto);
+    } else {
+      HashMap<String, Integer> results = new HashMap<String, Integer>();
+      results.put("deleted", 0);
+      results.put("updated", 0);
+      for (String tableId : tableIds) {
+        HashMap<String, Integer> partial = delete(adClientId, adOrgId, tableId, null, strdatefrom,
+            strdateto);
+        results.put("deleted", results.get("deleted") + partial.get("deleted"));
+        results.put("updated", results.get("updated") + partial.get("updated"));
+      }
+      return results;
+    }
+  }
+
   @SuppressWarnings("unchecked")
   public static HashMap<String, Integer> delete(String adClientId, String adOrgId,
       String adTableId, String recordId, String strdatefrom, String strdateto) throws OBException {
@@ -70,7 +91,8 @@
     String client = adClientId;
     List<String> tables = getTables(adTableId);
     try {
-      Set<String> orgIds = new OrganizationStructureProvider().getChildTree(adOrgId, true);
+      Set<String> orgIds = StringUtils.equals(adOrgId, "0") ? getLegalOrBusinessOrgsChilds(client)
+          : new OrganizationStructureProvider().getChildTree(adOrgId, true);
       for (String table : tables) {
         List<String> docbasetypes = getDocbasetypes(client, table, localRecordId);
         String myQuery = "select distinct e.recordID from FinancialMgmtAccountingFact e where e.organization.id in (:orgIds) and e.client.id = :clientId and e.table.id = :tableId";
@@ -85,7 +107,6 @@
           // organizationPeriodControl: hashmap with organizations and their organization allow
           // period control associated
           Map<String, String> organizationPeriodControl = new HashMap<String, String>();
-          String calendarId = getCalendarId(adOrgId);
 
           String myQuery1 = "select ad_org_id, ad_org_getperiodcontrolallow(ad_org_id) from ad_org where ad_org_id in (:orgIds)";
           Query query1 = OBDal.getInstance().getSession().createSQLQuery(myQuery1);
@@ -101,8 +122,9 @@
               if (orgperiodcontrol != null) {
                 organizationPeriodControl.put(organization, orgperiodcontrol);
                 if (!organizationPeriod.keySet().contains(orgperiodcontrol)) {
-                  periods = getPeriodsDates(getOpenPeriods(client, dbt, orgIds, calendarId, table,
-                      localRecordId, strdatefrom, strdateto, orgperiodcontrol));
+                  periods = getPeriodsDates(getOpenPeriods(client, dbt, orgIds,
+                      getCalendarId(organization), table, localRecordId, strdatefrom, strdateto,
+                      orgperiodcontrol));
                   organizationPeriod.put(orgperiodcontrol, periods);
                 }
               }
@@ -166,8 +188,8 @@
               // all
               // dates are within an open period
               HashMap<String, Integer> partial = treatExceptions(exceptionsSql, localRecordId,
-                  table, orgIds, client, p[0], p[1], calendarId, strdatefrom, strdateto, dbt,
-                  orgAllow, organization);
+                  table, orgIds, client, p[0], p[1], getCalendarId(organization), strdatefrom,
+                  strdateto, dbt, orgAllow, organization);
               deleted = deleted + partial.get("deleted");
               updated = updated + partial.get("updated");
               docUpdated = docUpdated + partial.get("updated");
@@ -294,15 +316,21 @@
 
   public static HashMap<String, Integer> restore(String clientId, String adOrgId, String datefrom,
       String dateto) throws OBException {
+    List<String> tableIds = null;
+    return restore(clientId, adOrgId, tableIds, datefrom, dateto);
+  }
+
+  public static HashMap<String, Integer> restore(String clientId, String adOrgId,
+      List<String> tableIds, String datefrom, String dateto) throws OBException {
     HashMap<String, Integer> results = new HashMap<String, Integer>();
     results.put("deleted", 0);
     results.put("updated", 0);
-    List<String> tableIds = getActiveTables(clientId, adOrgId);
-    for (String tableId : tableIds) {
+    List<String> tableIdList = CollectionUtils.isEmpty(tableIds) ? getActiveTables(clientId,
+        adOrgId) : tableIds;
+    for (String tableId : tableIdList) {
       HashMap<String, Integer> partial = restore(clientId, adOrgId, tableId, datefrom, dateto);
       results.put("deleted", results.get("deleted") + partial.get("deleted"));
       results.put("updated", results.get("updated") + partial.get("updated"));
-
     }
     return results;
   }
@@ -598,4 +626,31 @@
     count = ((Long) query.list().get(0)).intValue();
     return (count == 1);
   }
+
+  @SuppressWarnings("unchecked")
+  private static Set<String> getLegalOrBusinessOrgsChilds(String clientId) {
+    StringBuffer hql = new StringBuffer();
+    hql = new StringBuffer();
+    hql.append(" select o1." + Organization.PROPERTY_ID);
+    hql.append(" from " + Organization.ENTITY_NAME + " as o1");
+    hql.append(" , " + Organization.ENTITY_NAME + " as o2");
+    hql.append(" join o2." + Organization.PROPERTY_ORGANIZATIONTYPE + " as ot");
+    hql.append(" where o1." + Organization.PROPERTY_CLIENT + ".id = :clientId");
+    hql.append(" and o2." + Organization.PROPERTY_CLIENT + ".id = :clientId");
+    hql.append(" and ad_isorgincluded(o1." + Organization.PROPERTY_ID + ", o2."
+        + Organization.PROPERTY_ID + ", o1." + Organization.PROPERTY_CLIENT + ".id) <> -1");
+    hql.append(" and (ot." + OrganizationType.PROPERTY_LEGALENTITY + " = true");
+    hql.append(" or ot." + OrganizationType.PROPERTY_BUSINESSUNIT + " = true)");
+    hql.append(" and o1." + Organization.PROPERTY_ACTIVE + " = true");
+    hql.append(" and o1." + Organization.PROPERTY_READY + " = true");
+    hql.append(" and o2." + Organization.PROPERTY_ACTIVE + " = true");
+    hql.append(" and o2." + Organization.PROPERTY_READY + " = true");
+    hql.append(" order by o2." + Organization.PROPERTY_NAME);
+    hql.append(" , ad_isorgincluded(o1." + Organization.PROPERTY_ID + ", o2."
+        + Organization.PROPERTY_ID + ", o1." + Organization.PROPERTY_CLIENT + ".id)");
+    hql.append(" , o1." + Organization.PROPERTY_NAME);
+    Query query = OBDal.getInstance().getSession().createQuery(hql.toString());
+    query.setParameter("clientId", clientId);
+    return new HashSet<String>(query.list());
+  }
 }