CI: promote changesets from pi to main
authorRM packaging bot <staff.rm@openbravo.com>
Sat, 01 Sep 2012 00:54:34 +0200
changeset 17843 05b3ea484705
parent 17807 27572925a53f (current diff)
parent 17842 64d15cf83d31 (diff)
child 17865 2119e2bbc7a4
child 17890 2bbfc245d4ff
CI: promote changesets from pi to main
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml
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-db/database/sourcedata/AD_TAB.xml
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java
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.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.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/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MODULE.xml
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -6951,7 +6951,7 @@
 <!--A9FAC7D05AED45A28899DDFDF1D1D6E0-->  <DESCRIPTION><![CDATA[It is the method by which payment is expected to be made or received.]]></DESCRIPTION>
 <!--A9FAC7D05AED45A28899DDFDF1D1D6E0-->  <COLUMNNAME><![CDATA[FIN_Paymentmethod_ID]]></COLUMNNAME>
 <!--A9FAC7D05AED45A28899DDFDF1D1D6E0-->  <AD_TABLE_ID><![CDATA[DC814AB3BC84486CA5411131724BC95A]]></AD_TABLE_ID>
-<!--A9FAC7D05AED45A28899DDFDF1D1D6E0-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--A9FAC7D05AED45A28899DDFDF1D1D6E0-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
 <!--A9FAC7D05AED45A28899DDFDF1D1D6E0-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
 <!--A9FAC7D05AED45A28899DDFDF1D1D6E0-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--A9FAC7D05AED45A28899DDFDF1D1D6E0-->  <ISPARENT><![CDATA[N]]></ISPARENT>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -90,7 +90,7 @@
 <!--583D70554DDA45BD8C80C0AF11C64FC5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--583D70554DDA45BD8C80C0AF11C64FC5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--583D70554DDA45BD8C80C0AF11C64FC5-->  <COLUMNNAME><![CDATA[Invoice_Documentno]]></COLUMNNAME>
-<!--583D70554DDA45BD8C80C0AF11C64FC5-->  <NAME><![CDATA[Invoice Documentno]]></NAME>
+<!--583D70554DDA45BD8C80C0AF11C64FC5-->  <NAME><![CDATA[Invoice Document No.]]></NAME>
 <!--583D70554DDA45BD8C80C0AF11C64FC5-->  <PRINTNAME><![CDATA[Invoice_Documentno]]></PRINTNAME>
 <!--583D70554DDA45BD8C80C0AF11C64FC5-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--583D70554DDA45BD8C80C0AF11C64FC5-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
@@ -126,7 +126,7 @@
 <!--64B01B6184B84599B2B073BC7971EA19-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--64B01B6184B84599B2B073BC7971EA19-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--64B01B6184B84599B2B073BC7971EA19-->  <COLUMNNAME><![CDATA[Order_Documentno]]></COLUMNNAME>
-<!--64B01B6184B84599B2B073BC7971EA19-->  <NAME><![CDATA[Order Documentno]]></NAME>
+<!--64B01B6184B84599B2B073BC7971EA19-->  <NAME><![CDATA[Order Document No.]]></NAME>
 <!--64B01B6184B84599B2B073BC7971EA19-->  <PRINTNAME><![CDATA[Order_Documentno]]></PRINTNAME>
 <!--64B01B6184B84599B2B073BC7971EA19-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--64B01B6184B84599B2B073BC7971EA19-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -8765,7 +8765,7 @@
 <!--8AFD30956A0E4A079AA0D80B41A0A494-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--8AFD30956A0E4A079AA0D80B41A0A494-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8AFD30956A0E4A079AA0D80B41A0A494-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--8AFD30956A0E4A079AA0D80B41A0A494-->  <NAME><![CDATA[Order Documentno]]></NAME>
+<!--8AFD30956A0E4A079AA0D80B41A0A494-->  <NAME><![CDATA[Order Document No.]]></NAME>
 <!--8AFD30956A0E4A079AA0D80B41A0A494-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--8AFD30956A0E4A079AA0D80B41A0A494-->  <AD_TAB_ID><![CDATA[81644A22CC4D4B879AA71C33C30E00A4]]></AD_TAB_ID>
 <!--8AFD30956A0E4A079AA0D80B41A0A494-->  <AD_COLUMN_ID><![CDATA[02EF18D28F1B4C43ADF91B3E73C2BF12]]></AD_COLUMN_ID>
@@ -12548,7 +12548,7 @@
 <!--B4F12711D3DB4B14B7D0ADF22EBEB981-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--B4F12711D3DB4B14B7D0ADF22EBEB981-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--B4F12711D3DB4B14B7D0ADF22EBEB981-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--B4F12711D3DB4B14B7D0ADF22EBEB981-->  <NAME><![CDATA[Invoice Documentno]]></NAME>
+<!--B4F12711D3DB4B14B7D0ADF22EBEB981-->  <NAME><![CDATA[Invoice Document No.]]></NAME>
 <!--B4F12711D3DB4B14B7D0ADF22EBEB981-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--B4F12711D3DB4B14B7D0ADF22EBEB981-->  <AD_TAB_ID><![CDATA[81644A22CC4D4B879AA71C33C30E00A4]]></AD_TAB_ID>
 <!--B4F12711D3DB4B14B7D0ADF22EBEB981-->  <AD_COLUMN_ID><![CDATA[41DAD5FF72274650A3C41D103F20C111]]></AD_COLUMN_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.17839]]></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-db/database/sourcedata/AD_TAB.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TAB.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -251,9 +251,9 @@
 <!--81644A22CC4D4B879AA71C33C30E00A4-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
 <!--81644A22CC4D4B879AA71C33C30E00A4-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--81644A22CC4D4B879AA71C33C30E00A4-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
-<!--81644A22CC4D4B879AA71C33C30E00A4-->  <HQLWHERECLAUSE><![CDATA[((e.obSelected = true and e.paymentProposal.id = @FIN_Payment_Proposal.id@) or e.obSelected = false) and e.salesTransaction = false]]></HQLWHERECLAUSE>
+<!--81644A22CC4D4B879AA71C33C30E00A4-->  <HQLWHERECLAUSE><![CDATA[((e.obSelected = true and e.paymentProposal.id = @FIN_Payment_Proposal.id@) or e.obSelected = false) and e.salesTransaction = false  and e.currency.id= @FIN_Payment_Proposal.currency@ and (@FIN_Payment_Proposal.businessPartner@ is null OR @FIN_Payment_Proposal.businessPartner@ = '' OR @FIN_Payment_Proposal.businessPartner@ = e.businessPartner.id) and (@FIN_Payment_Proposal.duedate@ = '' OR @FIN_Payment_Proposal.duedate@ is null OR @FIN_Payment_Proposal.duedate@ = 'null' OR e.expectedDate <= to_date(@FIN_Payment_Proposal.duedate@,'YYYY-MM-DD'))]]></HQLWHERECLAUSE>
 <!--81644A22CC4D4B879AA71C33C30E00A4-->  <HQLORDERBYCLAUSE><![CDATA[obSelected desc, paymentPriority, expectedDate, coalesce(orderDocumentno, invoiceorderDocumentno)]]></HQLORDERBYCLAUSE>
-<!--81644A22CC4D4B879AA71C33C30E00A4-->  <HQLFILTERCLAUSE><![CDATA[(e.obSelected = true) OR (e.paymentMethod.id = @FIN_Payment_Proposal.paymentMethod@ and e.currency.id= @FIN_Payment_Proposal.currency@ and (@FIN_Payment_Proposal.businessPartner@ is null OR @FIN_Payment_Proposal.businessPartner@ = '' OR @FIN_Payment_Proposal.businessPartner@ = e.businessPartner.id) and (@FIN_Payment_Proposal.duedate@ = '' OR @FIN_Payment_Proposal.duedate@ is null OR e.expectedDate <= to_date(@FIN_Payment_Proposal.duedate@,'YYYY-MM-DD')))]]></HQLFILTERCLAUSE>
+<!--81644A22CC4D4B879AA71C33C30E00A4-->  <HQLFILTERCLAUSE><![CDATA[(e.obSelected = true) OR (e.paymentMethod.id = @FIN_Payment_Proposal.paymentMethod@)]]></HQLFILTERCLAUSE>
 <!--81644A22CC4D4B879AA71C33C30E00A4-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
 <!--81644A22CC4D4B879AA71C33C30E00A4-->  <EM_OBUIAPP_SELECTION><![CDATA[OB.APRM.selectionChangePaymentProposalPickAndEdit]]></EM_OBUIAPP_SELECTION>
 <!--81644A22CC4D4B879AA71C33C30E00A4-->  <EM_OBUIAPP_CAN_ADD><![CDATA[N]]></EM_OBUIAPP_CAN_ADD>
--- a/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/WrongPaymentScheduleDetailsCheck_data.xsql	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/WrongPaymentScheduleDetailsCheck_data.xsql	Sat Sep 01 00:54:34 2012 +0200
@@ -46,13 +46,16 @@
                         AND NOT EXISTS (SELECT 1 FROM fin_payment_scheduledetail psd
                                                       JOIN fin_payment_schedule psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_schedule_id
                                         WHERE il.c_invoice_id = psi.c_invoice_id
-                                          AND psd.fin_payment_schedule_order = pso.fin_payment_schedule_id))
+                                          AND psd.fin_payment_schedule_order = pso.fin_payment_schedule_id)
+                      GROUP BY il.c_invoice_id
+                      HAVING sum(il.linenetamt +coalesce(c_getinvoiceline_taxamount(il.c_invoiceline_id),0)) != 0)
         AND EXISTS (SELECT 1 FROM fin_payment_scheduledetail psdo
                     WHERE psdo.fin_payment_schedule_order = pso.fin_payment_schedule_id)) o
           JOIN c_orderline ol ON ol.c_order_id = o.c_order_id
           JOIN c_invoiceline il ON il.c_orderline_id = ol.c_orderline_id
           JOIN c_invoice i ON i.c_invoice_id = il.c_invoice_id
           WHERE i.docstatus <> 'VO'
+        AND NOT EXITS (SELECT 1 FROM c_invoice_reverse WHERE c_invoice_reverse.c_invoice_id = inv.c_invoice_id)
       ]]></Sql>
   </SqlMethod>
   <SqlMethod name="getUUID" type="preparedStatement" return="string">
@@ -165,13 +168,16 @@
                             AND NOT EXISTS (SELECT 1 FROM fin_payment_scheduledetail psd
                                                           JOIN fin_payment_schedule psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_schedule_id
                                             WHERE il.c_invoice_id = psi.c_invoice_id
-                                              AND psd.fin_payment_schedule_order = pso.fin_payment_schedule_id))
+                                              AND psd.fin_payment_schedule_order = pso.fin_payment_schedule_id)
+                          GROUP BY il.c_invoice_id
+                          HAVING sum(il.linenetamt +coalesce(c_getinvoiceline_taxamount(il.c_invoiceline_id),0)) != 0)
               AND EXISTS (SELECT 1 FROM fin_payment_scheduledetail psdo
                         WHERE psdo.fin_payment_schedule_order = pso.fin_payment_schedule_id)) o
             JOIN c_orderline ol ON ol.c_order_id = o.c_order_id
             JOIN c_invoiceline il ON il.c_orderline_id = ol.c_orderline_id
             JOIN c_invoice inv ON inv.c_invoice_id = il.c_invoice_id
-         WHERE inv.docstatus <> ''VO'' '
+         WHERE inv.docstatus <> ''VO'' 
+       AND NOT EXITS (SELECT 1 FROM c_invoice_reverse WHERE c_invoice_reverse.c_invoice_id = inv.c_invoice_id)'
       )
     ]]></Sql>
     <Parameter name="alertRuleId"/>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Sat Sep 01 00:54:34 2012 +0200
@@ -20,6 +20,7 @@
 package org.openbravo.advpaymentmngt.actionHandler;
 
 import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.log4j.Logger;
@@ -34,6 +35,7 @@
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.financialmgmt.payment.FIN_PaymentMethod;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentPropDetail;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentProposal;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentScheduleDetail;
@@ -57,14 +59,22 @@
       final String strPaymentProposalId = jsonRequest.getString("Fin_Payment_Proposal_ID");
       FIN_PaymentProposal paymentProposal = OBDal.getInstance().get(FIN_PaymentProposal.class,
           strPaymentProposalId);
+      final String strPaymentMethodId = jsonRequest.getString("inpfinPaymentmethodId");
+      FIN_PaymentMethod paymentMethod = OBDal.getInstance().get(FIN_PaymentMethod.class,
+          strPaymentMethodId);
 
       if (cleanPaymentProposalDetails(paymentProposal)) {
-        int cont = createPaymentProposalDetails(jsonRequest);
+        HashMap<String, String> map = createPaymentProposalDetails(jsonRequest, paymentMethod);
         jsonRequest = new JSONObject();
 
         JSONObject errorMessage = new JSONObject();
         errorMessage.put("severity", "success");
         errorMessage.put("text", OBMessageUtils.messageBD("Success"));
+        if (map.get("DifferentPaymentMethod").equals("true")) {
+          errorMessage.put("severity", "warning");
+          errorMessage.put("text",
+              OBMessageUtils.messageBD("APRM_Different_PaymentMethod_Selected"));
+        }
         jsonRequest.put("message", errorMessage);
       }
 
@@ -110,25 +120,34 @@
     return true;
   }
 
-  private int createPaymentProposalDetails(JSONObject jsonRequest) throws JSONException,
-      OBException {
+  private HashMap<String, String> createPaymentProposalDetails(JSONObject jsonRequest,
+      FIN_PaymentMethod paymentMethod) throws JSONException, OBException {
 
+    HashMap<String, String> map = new HashMap<String, String>();
+    map.put("DifferentPaymentMethod", "false");
+    map.put("Count", "0");
     JSONArray selectedLines = jsonRequest.getJSONArray("_selection");
     // if no lines selected don't do anything.
     if (selectedLines.length() == 0) {
-      return 0;
+      return map;
     }
     final String strPaymentProposalId = jsonRequest.getString("Fin_Payment_Proposal_ID");
     FIN_PaymentProposal paymentProposal = OBDal.getInstance().get(FIN_PaymentProposal.class,
         strPaymentProposalId);
     BigDecimal totalAmount = BigDecimal.ZERO, totalWriteOff = BigDecimal.ZERO;
     int cont = 0;
+    String differentPaymentMethod = "false";
     for (int i = 0; i < selectedLines.length(); i++) {
       JSONObject selectedLine = selectedLines.getJSONObject((int) i);
       log.debug(selectedLine);
       BigDecimal paidAmount = new BigDecimal(selectedLine.getString("payment"));
 
       if (paidAmount.compareTo(BigDecimal.ZERO) != 0) {
+        FIN_PaymentMethod linePaymentMethod = OBDal.getInstance().get(FIN_PaymentMethod.class,
+            selectedLine.getString("paymentMethod"));
+        if (!paymentMethod.equals(linePaymentMethod)) {
+          differentPaymentMethod = "true";
+        }
         FIN_PaymentPropDetail newPPD = OBProvider.getInstance().get(FIN_PaymentPropDetail.class);
         newPPD.setOrganization(paymentProposal.getOrganization());
         newPPD.setClient(paymentProposal.getClient());
@@ -156,6 +175,8 @@
     paymentProposal.setAmount(totalAmount);
     paymentProposal.setWriteoffAmount(totalWriteOff);
     OBDal.getInstance().save(paymentProposal);
-    return cont;
+    map.put("DifferentPaymentMethod", differentPaymentMethod);
+    map.put("Count", Integer.toString(cont));
+    return map;
   }
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.html	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.html	Sat Sep 01 00:54:34 2012 +0200
@@ -163,6 +163,9 @@
 }
 function openAddTransaction(bankStatementLineId){
   document.frmMain.inpFinBankStatementLineId.value = bankStatementLineId;
+  if ( document.getElementById('inpCheckBox_' + bankStatementLineId) && document.getElementById('inpCheckBox_' + bankStatementLineId).checked){
+    unMatchLine(bankStatementLineId, false);
+  }
   openServletNewWindow('DEFAULT', false, '../org.openbravo.advpaymentmngt.ad_actionbutton/AddTransaction.html', 'ADDTRANSACTION', '2EED9BC16DB34D2B80BA40A21564BECF', false,600, 900, null, null, false, true, true);
   return true;
 }
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--15D7CE8D95D043189162DBABA54A1F61-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--60A170212F36499D83B8AD38D01F46B3-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--824D60CB352E4099B1D8C903CA139DAE-->  <STARTVERSION><![CDATA[3.0.17839]]></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.17787]]></STARTVERSION>
+<!--E8FD820AFE3D4FE08C02FC47769026AD-->  <STARTVERSION><![CDATA[8.1.17839]]></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-db/database/sourcedata/AD_PREFERENCE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_PREFERENCE.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -50,7 +50,6 @@
   {"id": "ViewGrid_EditInGrid", "keyComb": {"key": "f2"}},
   {"id": "ViewGrid_CancelEditing", "keyComb": {"key": "Escape"}},
   {"id": "ViewGrid_DeleteSelectedRecords", "keyComb": {"key": "Delete"}},
-  {"id": "ViewGrid_CancelChanges", "keyComb": {"key": "Escape"}},
   {"id": "ViewForm_OpenLinkOut", "keyComb": {"ctrl": true, "alt": true, "key": "Enter"}},
   {"id": "Selector_ShowPopup", "keyComb": {"ctrl": true, "key": "Enter"}},
   {"id": "SelectorLink_ShowPopup", "keyComb": {"ctrl": true, "key": "Enter"}}
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/MultipleDeleteActionHandler.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/MultipleDeleteActionHandler.java	Sat Sep 01 00:54:34 2012 +0200
@@ -51,6 +51,9 @@
         final BaseOBObject object = OBDal.getInstance().get(entityName, (String) ids.get(i));
         if (object != null) {
           OBDal.getInstance().remove(object);
+          // https://issues.openbravo.com/view.php?id=21229#c51631
+          OBDal.getInstance().flush();
+          OBDal.getInstance().getSession().clear();
         }
       }
       OBDal.getInstance().commitAndClose();
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js	Sat Sep 01 00:54:34 2012 +0200
@@ -240,11 +240,22 @@
       getMDIKS: function () {
         var key, auxKey, action, funcParam, keyMap, ClassicKeyJSON = [],
             LKS = O.KeyboardManager.Shortcuts,
-            i, length = LKS.list.length;
+            i, j, isCanvasShortcut, length = LKS.list.length;
 
         for (i = 0; i < length; i++) {
           auxKey = '';
-          if (LKS.list[i].isGlobal) {
+          isCanvasShortcut = false;
+
+          if (LKS.list[i].execLevel) {
+            for (j = 0; j < LKS.list[i].execLevel.length; j++) {
+              if (LKS.list[i].execLevel[j] === 'Canvas') {
+                isCanvasShortcut = true;
+                break;
+              }
+            }
+          }
+
+          if (isCanvasShortcut) {
             if (LKS.list[i].keyComb.ctrl === true) {
               if (auxKey.length > 0) {
                 auxKey += '+';
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js	Sat Sep 01 00:54:34 2012 +0200
@@ -474,7 +474,7 @@
   }
 
   type = item.typeInstance;
-  validator.resultingValue = null;
+  delete validator.resultingValue;
 
   // return a formatted value, if it was valid
   if (isc.isA.String(value)) {
@@ -491,6 +491,7 @@
       return false;
     }
   } else if (isc.isA.Number(value)) {
+    validator.resultingValue = value;
     return true;
   }
   // don't loose illegal values
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Sat Sep 01 00:54:34 2012 +0200
@@ -1807,6 +1807,10 @@
   },
 
   keyDown: function () {
+    if (this.grid && this.grid.editFormKeyDown) {
+      // To fix issue https://issues.openbravo.com/view.php?id=21382
+      this.grid.editFormKeyDown(arguments);
+    }
     var response = OB.KeyboardManager.Shortcuts.monitor('OBViewForm');
     if (response !== false) {
       response = this.Super('keyDown', arguments);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Sat Sep 01 00:54:34 2012 +0200
@@ -61,36 +61,35 @@
   },
 
   enableShortcuts: function () {
-    var me = this,
-        ksAction_FocusFilter, ksAction_FocusGrid, ksAction_ClearFilter, ksAction_SelectAll, ksAction_UnselectAll;
+    var ksAction_FocusFilter, ksAction_FocusGrid, ksAction_ClearFilter, ksAction_SelectAll, ksAction_UnselectAll;
 
-    ksAction_FocusFilter = function () {
-      me.focusInFirstFilterEditor();
+    ksAction_FocusFilter = function (caller) {
+      caller.focusInFirstFilterEditor();
       return false; //To avoid keyboard shortcut propagation
     };
-    OB.KeyboardManager.Shortcuts.set('Grid_FocusFilter', 'OBGrid.body', ksAction_FocusFilter);
+    OB.KeyboardManager.Shortcuts.set('Grid_FocusFilter', ['OBGrid.body', 'OBGrid.editForm'], ksAction_FocusFilter);
 
-    ksAction_FocusGrid = function () {
-      me.focus();
+    ksAction_FocusGrid = function (caller) {
+      caller.focus();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('Grid_FocusGrid', 'OBGrid.filter', ksAction_FocusGrid);
 
-    ksAction_ClearFilter = function () {
-      me.clearFilter(true);
+    ksAction_ClearFilter = function (caller) {
+      caller.clearFilter(true);
       return false; //To avoid keyboard shortcut propagation
     };
-    OB.KeyboardManager.Shortcuts.set('Grid_ClearFilter', ['OBGrid.body', 'OBGrid.filter'], ksAction_ClearFilter);
+    OB.KeyboardManager.Shortcuts.set('Grid_ClearFilter', ['OBGrid.body', 'OBGrid.filter', 'OBGrid.editForm'], ksAction_ClearFilter);
 
-    ksAction_SelectAll = function () {
-      me.selectAllRecords();
+    ksAction_SelectAll = function (caller) {
+      caller.selectAllRecords();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('Grid_SelectAll', 'OBGrid.body', ksAction_SelectAll);
 
-    ksAction_UnselectAll = function () {
-      if (me.getSelectedRecords().length > 1) {
-        me.deselectAllRecords();
+    ksAction_UnselectAll = function (caller) {
+      if (caller.getSelectedRecords().length > 1) {
+        caller.deselectAllRecords();
       }
       return false; //To avoid keyboard shortcut propagation
     };
@@ -103,18 +102,27 @@
   },
 
   bodyKeyPress: function (event, eventInfo) {
-    if ((eventInfo.keyName === isc.OBViewGrid.ARROW_UP_KEY_NAME && this.data.localData[0].id === this.lastSelectedRecord.id) || (eventInfo.keyName === isc.OBViewGrid.ARROW_DOWN_KEY_NAME && this.data.localData[this.data.localData.length - 1] && this.data.localData[this.data.localData.length - 1].id === this.lastSelectedRecord.id)) {
+    if (eventInfo && this.lastSelectedRecord && ((eventInfo.keyName === isc.OBViewGrid.ARROW_UP_KEY_NAME && this.data.localData[0].id === this.lastSelectedRecord.id) || (eventInfo.keyName === isc.OBViewGrid.ARROW_DOWN_KEY_NAME && this.data.localData[this.data.localData.length - 1] && this.data.localData[this.data.localData.length - 1].id === this.lastSelectedRecord.id))) {
       return true;
     }
-    var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.body');
+    var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.body', this);
     if (response !== false) {
       response = this.Super('bodyKeyPress', arguments);
     }
     return response;
   },
 
+  editFormKeyDown: function () {
+    // Custom method. Only works if the form is an OBViewForm
+    var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.editForm', this);
+    if (response !== false) {
+      response = this.Super('editFormKeyDown', arguments);
+    }
+    return response;
+  },
+
   filterFieldsKeyDown: function (item, form, keyName) {
-    var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.filter');
+    var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.filter', this.grid.fieldSourceGrid);
     if (response !== false) {
       response = this.Super('filterFieldsKeyDown', arguments);
     }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Sat Sep 01 00:54:34 2012 +0200
@@ -125,7 +125,9 @@
   // it is better to allow fast grid interaction and if an error occurs
   // dismiss any new records being edited and go back to the edit row
   // which causes the error
-  waitForSave: false,
+  // set to true to solve this issue:
+  // https://issues.openbravo.com/view.php?id=21352
+  waitForSave: true,
   stopOnErrors: false,
   confirmDiscardEdits: false,
   canMultiSort: false,
@@ -693,7 +695,7 @@
   bodyKeyPress: function (event, eventInfo) {
     var response = OB.KeyboardManager.Shortcuts.monitor('OBViewGrid.body');
     if (response !== false) {
-      if (event.keyName === 'Space' && (isc.EventHandler.ctrlKeyDown() || isc.EventHandler.altKeyDown() || isc.EventHandler.shiftKeyDown())) {
+      if (event && event.keyName === 'Space' && (isc.EventHandler.ctrlKeyDown() || isc.EventHandler.altKeyDown() || isc.EventHandler.shiftKeyDown())) {
         return true;
       }
       response = this.Super('bodyKeyPress', arguments);
@@ -701,6 +703,15 @@
     return response;
   },
 
+  editFormKeyDown: function () {
+    // Custom method. Only works if the form is an OBViewForm
+    var response = OB.KeyboardManager.Shortcuts.monitor('OBViewGrid.editForm');
+    if (response !== false) {
+      response = this.Super('editFormKeyDown', arguments);
+    }
+    return response;
+  },
+
   // called when the view gets activated
   setActive: function (active) {
     if (active) {
@@ -723,16 +734,7 @@
     var me = this,
         ksAction_CancelEditing, ksAction_MoveUpWhileEditing, ksAction_MoveDownWhileEditing, ksAction_DeleteSelectedRecords, ksAction_EditInGrid, ksAction_EditInForm, ksAction_CancelChanges;
 
-    ksAction_CancelEditing = function () {
-      if (me.getEditForm()) {
-        me.cancelEditing();
-        return false; //To avoid keyboard shortcut propagation
-      } else {
-        return true;
-      }
-    };
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_CancelEditing', ['OBViewGrid', 'OBViewGrid.body'], ksAction_CancelEditing);
-
+    // This is JUST for the case of an editing row with the whole row in "read only mode"
     ksAction_MoveUpWhileEditing = function () {
       if (me.getEditForm()) {
         var editRow = me.getEditRow();
@@ -745,10 +747,11 @@
         return true;
       }
     };
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_MoveUpWhileEditing', ['OBViewGrid', 'OBViewGrid.body'], ksAction_MoveUpWhileEditing, null, {
+    OB.KeyboardManager.Shortcuts.set('ViewGrid_MoveUpWhileEditing', 'OBViewGrid.body', ksAction_MoveUpWhileEditing, null, {
       "key": "Arrow_Up"
     });
 
+    // This is JUST for the case of an editing row with the whole row in "read only mode"
     ksAction_MoveDownWhileEditing = function () {
       if (me.getEditForm()) {
         var editRow = me.getEditRow();
@@ -761,10 +764,20 @@
         return true;
       }
     };
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_MoveDownWhileEditing', ['OBViewGrid', 'OBViewGrid.body'], ksAction_MoveDownWhileEditing, null, {
+    OB.KeyboardManager.Shortcuts.set('ViewGrid_MoveDownWhileEditing', 'OBViewGrid.body', ksAction_MoveDownWhileEditing, null, {
       "key": "Arrow_Down"
     });
 
+    ksAction_CancelEditing = function () {
+      if (me.getEditForm()) {
+        me.cancelEditing();
+        return false; //To avoid keyboard shortcut propagation
+      } else {
+        return true;
+      }
+    };
+    OB.KeyboardManager.Shortcuts.set('ViewGrid_CancelEditing', ['OBViewGrid.body', 'OBViewGrid.editForm'], ksAction_CancelEditing);
+
     ksAction_DeleteSelectedRecords = function () {
       var isDeletingEnabled = !me.view.toolBar.getLeftMember(isc.OBToolbar.TYPE_DELETE).disabled;
       if (me.getSelectedRecords().length > 0 && isDeletingEnabled) {
@@ -796,13 +809,7 @@
         return true;
       }
     };
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_EditInForm', 'OBViewGrid.body', ksAction_EditInForm);
-
-    ksAction_CancelChanges = function () {
-      me.view.undo();
-      return false;
-    };
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_CancelChanges', 'OBViewGrid.body', ksAction_CancelChanges);
+    OB.KeyboardManager.Shortcuts.set('ViewGrid_EditInForm', ['OBViewGrid.body', 'OBViewGrid.editForm'], ksAction_EditInForm);
 
     this.Super('enableShortcuts', arguments);
   },
@@ -2161,6 +2168,15 @@
     var nextEditCell = ((rowNum || rowNum === 0) && (colNum || colNum === 0) ? this.getNextEditCell(rowNum, colNum, editCompletionEvent) : null);
     var newRow = nextEditCell && nextEditCell[0] !== rowNum;
     var enterKey = editCompletionEvent === 'enter';
+
+    // no newValue, compute it, this because in the super method there is a check
+    // how many arguments are passed on, sometimes the newValue is not passed in
+    // and then it must be recomputed, so if we then use the undefined newValue
+    // in the actionObject below things will go wrong
+    if (arguments.length < 2) {
+      newValue = this.getEditValue(rowNum, colNum);
+    }
+
     if (!this.view.standardWindow.isAutoSaveEnabled() && !enterKey && !autoSaveDone && newRow && (editForm.hasChanged || editForm.isNew)) {
       var actionObject = {
         target: this,
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Sat Sep 01 00:54:34 2012 +0200
@@ -236,7 +236,7 @@
 
     this.Super('initWidget', arguments);
 
-    this.toolBar.updateButtonState(true);
+    this.toolBar.updateButtonState(true, false, true);
   },
 
   show: function () {
@@ -770,6 +770,7 @@
       if (this.isShowingForm && !this.viewForm.isNew) {
         this.setTargetRecordInWindow(this.viewGrid.getSelectedRecord().id);
       }
+      this.toolBar.updateButtonState(true, false, true);
     } else {
 
       // close any editors we may have
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js	Sat Sep 01 00:54:34 2012 +0200
@@ -211,8 +211,12 @@
     ksAction = function () {
       if (!me.menu.showing) {
         isc.EH.clickMaskClick();
+        setTimeout(function () {
+          me.showMenu();
+        }, 10); //setTimeout to avoid delayCall function that manages the focus
+      } else {
+        me.menu.hide();
       }
-      me.click();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set(this.keyboardShortcutId, 'Canvas', ksAction);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js	Sat Sep 01 00:54:34 2012 +0200
@@ -109,7 +109,7 @@
     if (this.modal) {
       allProperties.Command = this.command;
       callbackFunction = function () {
-        var popup = OB.Layout.ClassicOBCompatibility.Popup.open('process', 900, 600, OB.Utilities.applicationUrl(me.obManualURL), '', null, false, false, true, allProperties);
+        var popup = OB.Layout.ClassicOBCompatibility.Popup.open('process', 900, 600, OB.Utilities.applicationUrl(me.obManualURL), '', null, true, true, true, allProperties);
         if (autosaveButton) {
           // Back to header if autosave button
           popup.activeViewWhenClosed = theView;
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Sat Sep 01 00:54:34 2012 +0200
@@ -620,10 +620,10 @@
   // 
   // NOTE: new buttons should implement the updateState method.
   //
-  updateButtonState: function (noSetSession, changeEvent) {
+  updateButtonState: function (noSetSession, changeEvent, forceUpdate) {
     var me = this,
         isActiveTab = false;
-    if (this.view && this.view.isActiveView && this.view.isActiveView()) {
+    if (forceUpdate || (this.view && this.view.isActiveView && this.view.isActiveView())) {
       this.fireOnPause('updateButtonState', function () {
         me.pausedUpdateButtonState(noSetSession, changeEvent);
       });
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js	Sat Sep 01 00:54:34 2012 +0200
@@ -263,9 +263,9 @@
         }
       },
 
-      execute: function (position) {
+      execute: function (position, caller) {
         if (this.list[position].action !== null && typeof this.list[position].action === 'function') {
-          return this.list[position].action(this.list[position].funcParam);
+          return this.list[position].action(caller, this.list[position].funcParam);
         } else {
           return true;
         }
@@ -275,7 +275,7 @@
         return this.list;
       },
 
-      monitor: function (execLevel) {
+      monitor: function (execLevel, caller) {
         var i, j, length = this.list.length,
             position = null,
             pushedKS = {};
@@ -313,7 +313,7 @@
         }
 
         if (position !== null) {
-          return this.execute(position);
+          return this.execute(position, caller);
         } else {
           return true;
         }
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION><![CDATA[1.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--DCE798FBC5B648F7A3C81A6941720A57-->  <STARTVERSION><![CDATA[2.1.17839]]></STARTVERSION>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <DEPENDANT_MODULE_NAME><![CDATA[My Openbravo Tab]]></DEPENDANT_MODULE_NAME>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--26B041893E844A53AFA58BC326C4F0D7-->  <STARTVERSION><![CDATA[3.0.17839]]></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.17787]]></STARTVERSION>
+<!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <STARTVERSION><![CDATA[1.1.17839]]></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.17787]]></STARTVERSION>
+<!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <STARTVERSION><![CDATA[2.0.17839]]></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/BaseComponent.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java	Sat Sep 01 00:54:34 2012 +0200
@@ -312,4 +312,8 @@
   protected boolean isClassicMode() {
     return getApplicationName().equals(ComponentResource.APP_CLASSIC);
   }
+
+  public boolean bypassAuthentication() {
+    return false;
+  }
 }
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelServlet.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelServlet.java	Sat Sep 01 00:54:34 2012 +0200
@@ -91,6 +91,19 @@
     servletContext = config.getServletContext();
   }
 
+  public void service(final HttpServletRequest request, HttpServletResponse response)
+      throws ServletException, IOException {
+
+    final String action = request.getParameter(KernelConstants.ACTION_PARAMETER);
+    if (action == null) {
+      Component component = getComponent(request);
+      if (component instanceof BaseComponent && ((BaseComponent) component).bypassAuthentication()) {
+        request.getSession().setAttribute("forceLogin", "Y");
+      }
+    }
+    super.service(request, response);
+  }
+
   @Override
   public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
       ServletException {
@@ -107,8 +120,7 @@
     }
   }
 
-  protected void processComponentRequest(HttpServletRequest request, HttpServletResponse response)
-      throws IOException, ServletException {
+  private Component getComponent(HttpServletRequest request) {
 
     final int nameIndex = request.getRequestURI().indexOf(servletPathPart);
     final String servicePart = request.getRequestURI().substring(nameIndex);
@@ -117,7 +129,6 @@
       throw new UnsupportedOperationException("No service name present in url "
           + request.getRequestURI());
     }
-
     final String componentProviderName = pathParts[1];
 
     final ComponentProvider componentProvider = componentProviders.select(
@@ -132,6 +143,12 @@
 
     final Map<String, Object> parameters = getParameterMap(request);
     final Component component = componentProvider.getComponent(componentId, parameters);
+    return component;
+  }
+
+  protected void processComponentRequest(HttpServletRequest request, HttpServletResponse response)
+      throws IOException, ServletException {
+    Component component = getComponent(request);
     OBContext.setAdminMode();
     String eTag;
     try {
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--15F51F03882F444CAB6593B4566DC929-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--E71B28FC949D481D9F59C17D01E46EF9-->  <STARTVERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION><![CDATA[1.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--26558497C31140BFAB067BA4BC47D799-->  <STARTVERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--FF8080812D842086012D844F3CC0003E-->  <VERSION><![CDATA[0.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--FF8080812D842086012D845002070046-->  <STARTVERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--A3B449C4D5FE4D688CC58236FE33B802-->  <STARTVERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION><![CDATA[1.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <STARTVERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <STARTVERSION><![CDATA[1.1.17839]]></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.17787]]></STARTVERSION>
+<!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <STARTVERSION><![CDATA[2.0.17839]]></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.17787]]></STARTVERSION>
+<!--4FCE95802A854F7E8623AFF7C33D13EE-->  <STARTVERSION><![CDATA[3.0.17839]]></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.17787]]></STARTVERSION>
+<!--54AF8B39C55E4E7496902893ECD82786-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--D03C56D8A4E14F45A5466350E05C631F-->  <STARTVERSION><![CDATA[8.1.17839]]></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.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--FF8080813129ADA401312CA1222A0005-->  <VERSION><![CDATA[0.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--FF8080813141B198013141BA0F7D0012-->  <STARTVERSION><![CDATA[0.1.17839]]></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.17787]]></STARTVERSION>
+<!--FF8080813151AEE1013151C4ACE6001B-->  <STARTVERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--FF8080813141B198013141B86DD70003-->  <VERSION><![CDATA[0.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--FF8080813141B198013141B8B21B0006-->  <STARTVERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION><![CDATA[2.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--9E3E7B42DB16405FB794496D309D7044-->  <STARTVERSION><![CDATA[3.0.17839]]></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.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--38825CAED43941D38CA0C78DB04FCFA0-->  <STARTVERSION><![CDATA[8.1.17839]]></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.17787]]></STARTVERSION>
+<!--6DDE7B1A70174242AF82B5022FB89279-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--94F9CD2CB5EF4467A67475C786C984A7-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <STARTVERSION><![CDATA[1.1.17839]]></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.17787]]></STARTVERSION>
+<!--C8DAC574B88649D08C9468521B343F12-->  <STARTVERSION><![CDATA[3.0.17839]]></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.17787]]></STARTVERSION>
+<!--F14EB17946BE4724A46F80CB1A47EC70-->  <STARTVERSION><![CDATA[2.1.17839]]></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.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js	Sat Sep 01 00:54:34 2012 +0200
@@ -48,8 +48,7 @@
     cancelButton = isc.OBFormButton.create({
       title: OB.I18N.getLabel('OBUISC_Dialog.CANCEL_BUTTON_TITLE'),
       click: function () {
-        selectorWindow.hide();
-        selectorWindow.selector.focusInItem();
+        selectorWindow.closeClick();
       }
     });
 
@@ -209,6 +208,7 @@
 
   closeClick: function () {
     this.hide(arguments);
+    this.selector.focusInItem();
   },
 
   hide: function () {
@@ -416,11 +416,10 @@
   },
 
   enableShortcuts: function () {
-    var me = this,
-        ksAction_ShowPopup;
+    var ksAction_ShowPopup;
 
-    ksAction_ShowPopup = function () {
-      me.openSelectorWindow();
+    ksAction_ShowPopup = function (caller) {
+      caller.openSelectorWindow();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('Selector_ShowPopup', ['OBSelectorItem', 'OBSelectorItem.icon'], ksAction_ShowPopup);
@@ -429,12 +428,13 @@
   init: function () {
     this.enableShortcuts();
     this.icons = [{
+      selector: this,
       src: this.popupIconSrc,
       width: this.popupIconWidth,
       height: this.popupIconHeight,
       hspace: this.popupIconHspace,
       keyPress: function (keyName, character, form, item, icon) {
-        var response = OB.KeyboardManager.Shortcuts.monitor('OBSelectorItem.icon');
+        var response = OB.KeyboardManager.Shortcuts.monitor('OBSelectorItem.icon', this.selector);
         if (response !== false) {
           response = this.Super('keyPress', arguments);
         }
@@ -574,7 +574,7 @@
   },
 
   keyPress: function (item, form, keyName, characterValue) {
-    var response = OB.KeyboardManager.Shortcuts.monitor('OBSelectorItem');
+    var response = OB.KeyboardManager.Shortcuts.monitor('OBSelectorItem', this);
     if (response !== false) {
       response = this.Super('keyPress', arguments);
     }
@@ -756,7 +756,7 @@
   },
 
   keyPress: function (item, form, keyName, characterValue) {
-    var response = OB.KeyboardManager.Shortcuts.monitor('OBSelectorLinkItem');
+    var response = OB.KeyboardManager.Shortcuts.monitor('OBSelectorLinkItem', this);
     if (response !== false) {
       response = this.Super('keyPress', arguments);
     }
@@ -822,10 +822,10 @@
   },
 
   enableShortcuts: function () {
-    var me = this,
-        ksAction_ShowPopup;
-    ksAction_ShowPopup = function () {
-      me.showPicker();
+    var ksAction_ShowPopup;
+
+    ksAction_ShowPopup = function (caller) {
+      caller.showPicker();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('SelectorLink_ShowPopup', 'OBSelectorLinkItem', ksAction_ShowPopup);
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION><![CDATA[2.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--39BF75AD9AB3453698BF5DE29E727AA9-->  <STARTVERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION><![CDATA[8.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--086331E18477496B8AC74D2CFEBD1307-->  <STARTVERSION><![CDATA[3.0.17839]]></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.17787]]></STARTVERSION>
+<!--DC5D4EF450244482BD2B458DAA496333-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--F2AF15C0AF5540E393D96BE506E20648-->  <STARTVERSION><![CDATA[1.1.17839]]></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.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--148A000EE9A04A3CA653B1296A00B8E6-->  <STARTVERSION><![CDATA[3.0.17839]]></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.17787]]></STARTVERSION>
+<!--30F966407A6F4E15965821BAEE34D25B-->  <STARTVERSION><![CDATA[3.0.17839]]></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.17787]]></STARTVERSION>
+<!--F93CE30003B24F8F8886510B0065EECC-->  <STARTVERSION><![CDATA[1.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION><![CDATA[2.1.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></STARTVERSION>
+<!--01E1BCCEC9114DE0960538DF34E30E6F-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--025B181F63CA47B48A920F6983242390-->  <STARTVERSION><![CDATA[3.0.17839]]></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.17787]]></STARTVERSION>
+<!--054B4FEAF919478AA3FF27098A46D1D6-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <STARTVERSION><![CDATA[1.0.17839]]></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.17787]]></STARTVERSION>
+<!--224754C3EF674C93B0D468F47BAAB824-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--5B72D24032DD4879A950194139D961B6-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--8730CA6A4224439D82E0DD31B3806E36-->  <STARTVERSION><![CDATA[1.0.17839]]></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.17787]]></STARTVERSION>
+<!--98C47FF058F8413B8A2B26036061446E-->  <STARTVERSION><![CDATA[8.1.17839]]></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.17787]]></STARTVERSION>
+<!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <STARTVERSION><![CDATA[2.0.17839]]></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.17787]]></STARTVERSION>
+<!--A9CB99330AF34944877F889DD8A0AB3C-->  <STARTVERSION><![CDATA[2.1.17839]]></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.17787]]></STARTVERSION>
+<!--E72A053A403C4A98A189C105B850ADB0-->  <STARTVERSION><![CDATA[1.1.17839]]></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.17787]]></STARTVERSION>
+<!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <STARTVERSION><![CDATA[2.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION><![CDATA[3.0.17839]]></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 Aug 31 15:27:48 2012 +0200
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -7,7 +7,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.17787]]></STARTVERSION>
+<!--4D11E3A70650475381139522373CD191-->  <STARTVERSION><![CDATA[2.1.17839]]></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>
@@ -21,7 +21,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.17787]]></STARTVERSION>
+<!--52CE523C40634C47A99C6EBBD9C3125C-->  <STARTVERSION><![CDATA[3.0.17839]]></STARTVERSION>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <DEPENDANT_MODULE_NAME><![CDATA[Payment Report]]></DEPENDANT_MODULE_NAME>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,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.17787]]></STARTVERSION>
+<!--60834727BB114764ACEF019F40A34562-->  <STARTVERSION><![CDATA[1.1.17839]]></STARTVERSION>
 <!--60834727BB114764ACEF019F40A34562-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--60834727BB114764ACEF019F40A34562-->  <DEPENDANT_MODULE_NAME><![CDATA[Orders Awaiting Delivery]]></DEPENDANT_MODULE_NAME>
 <!--60834727BB114764ACEF019F40A34562-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,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.17787]]></STARTVERSION>
+<!--8418885E97D643138B6D907671351E3D-->  <STARTVERSION><![CDATA[3.0.17839]]></STARTVERSION>
 <!--8418885E97D643138B6D907671351E3D-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--8418885E97D643138B6D907671351E3D-->  <DEPENDANT_MODULE_NAME><![CDATA[Standard Roles]]></DEPENDANT_MODULE_NAME>
 <!--8418885E97D643138B6D907671351E3D-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,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.17787]]></STARTVERSION>
+<!--A32F3279B3374FC0A6CFEA2368BB7053-->  <STARTVERSION><![CDATA[3.0.17839]]></STARTVERSION>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MINOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,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.17787]]></STARTVERSION>
+<!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <STARTVERSION><![CDATA[3.0.17839]]></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>
@@ -91,7 +91,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.17787]]></STARTVERSION>
+<!--FF8080813189932B013189B45B59003A-->  <STARTVERSION><![CDATA[0.1.17839]]></STARTVERSION>
 <!--FF8080813189932B013189B45B59003A-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8080813189932B013189B45B59003A-->  <DEPENDANT_MODULE_NAME><![CDATA[OpenID Service Integration]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813189932B013189B45B59003A-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -105,7 +105,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.17787]]></STARTVERSION>
+<!--FF8080813189932B013189B4C00F003D-->  <STARTVERSION><![CDATA[0.1.17839]]></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>
@@ -119,7 +119,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.17787]]></STARTVERSION>
+<!--FF8081812E2F6F3C012E2F750109001C-->  <STARTVERSION><![CDATA[0.0.17839]]></STARTVERSION>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <DEPENDANT_MODULE_NAME><![CDATA[Widgets Collection]]></DEPENDANT_MODULE_NAME>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/src-db/database/model/functions/C_COMMISSION_PROCESS.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/src-db/database/model/functions/C_COMMISSION_PROCESS.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -139,6 +139,7 @@
     AD_Sequence_Doc('DocumentNo_C_CommissionRun', v_AD_Client_ID, 'Y', v_DocumentNo) ;
     DBMS_OUTPUT.PUT_LINE('Create: ' || v_DocumentNo || ' - ' || v_Name) ;
     v_ResultStr:='InsertingHeader';
+    v_C_CommissionRun_ID:= get_uuid();
     INSERT
     INTO C_CommissionRun
       (
@@ -149,13 +150,12 @@
       )
       VALUES
       (
-        get_uuid(), v_Record_ID, v_AD_Client_ID, v_AD_Org_ID,
+        v_C_CommissionRun_ID, v_Record_ID, v_AD_Client_ID, v_AD_Org_ID,
          'Y', now(), '0', now(),
         '0', v_DocumentNo, v_Name, v_StartDate,
         0, 'N', 'N'
-      )
+      )  
       ;
-    select C_CommissionRun_ID INTO  v_C_CommissionRun_ID from C_CommissionRun where created = (select max(created) from C_CommissionRun);
     --
     v_ResultStr:='Update Record';
     UPDATE C_Commission
--- a/src-db/database/model/triggers/FIN_FINANCIAL_ACCOUNT_TRG.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/src-db/database/model/triggers/FIN_FINANCIAL_ACCOUNT_TRG.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -14,7 +14,7 @@
     * under the License.
     * The Original Code is Openbravo ERP.
     * The Initial Developer of the Original Code is Openbravo SLU
-    * All portions are Copyright (C) 2010 Openbravo SLU
+    * All portions are Copyright (C) 2010-2012 Openbravo SLU
     * All Rights Reserved.
     * Contributor(s):  ______________________________________.
     ************************************************************************/
@@ -62,7 +62,7 @@
             :new.UpdatedBy, v_AssetAccount, 
             v_AssetAccount, null, null, Cur_Defaults.B_Expense_Acct, 
             Cur_Defaults.B_RevaluationGain_Acct, Cur_Defaults.B_RevaluationLoss_Acct, Cur_Defaults.B_InTransit_Acct,
-            null, Cur_Defaults.B_InTransit_Acct, null);
+            v_AssetAccount, Cur_Defaults.B_InTransit_Acct, v_AssetAccount);
 
     END LOOP;
   ELSIF (UPDATING) THEN
--- a/src-db/database/model/triggers/M_INOUTLINE_TRG.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/src-db/database/model/triggers/M_INOUTLINE_TRG.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -21,6 +21,7 @@
   v_ISSOTRX CHAR(1);
   v_QTYVARIABLE CHAR(1);
   v_OrderProduct VARCHAR2(32);
+  v_IsUpdateDifferentProduct BOOLEAN;
 /******************************************************************************
  * The contents of this file are subject to the   Compiere License  Version 1.1
  * ("License"); You may not use this file except in compliance with the License
@@ -165,9 +166,12 @@
    END IF;
  END IF;
 
+ IF (UPDATING) THEN
+   v_IsUpdateDifferentProduct := COALESCE(:OLD.m_product_id, '0') <> COALESCE(:NEW.m_product_id, '0');
+ END IF;
 
  -- Do not allow different product than the one in the related orderline.
- IF ((UPDATING OR INSERTING)) THEN
+ IF (INSERTING OR v_IsUpdateDifferentProduct) THEN
    IF (:new.C_OrderLine_ID is not null) THEN
      SELECT m_product_id INTO v_OrderProduct FROM C_OrderLine WHERE C_OrderLine_ID = :new.C_OrderLine_ID;
      IF (v_OrderProduct <> :new.M_Product_ID) THEN
@@ -175,7 +179,6 @@
      END IF;
    END IF;
  END IF;
-
  
  -- UPDATING inventory
  IF (UPDATING OR DELETING) THEN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/M_INOUTLINE_TRG2.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER M_INOUTLINE_TRG2">
+    <trigger name="M_INOUTLINE_TRG2" table="M_INOUTLINE" fires="after" insert="true" update="true" delete="false" foreach="statement">
+      <body><![CDATA[
+
+
+
+
+/*************************************************************************
+* 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) 2012 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+
+v_Count NUMBER;
+
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+    SELECT MAX(A.NUM)
+    INTO v_Count
+    FROM (
+    SELECT COUNT(*) AS NUM
+    FROM c_orderline ol
+         LEFT JOIN m_inoutline iol ON ol.c_orderline_id = iol.c_orderline_id
+    GROUP BY ol.qtyordered, iol.c_orderline_id
+    HAVING SUM(iol.movementqty) > ol.qtyordered) A;
+
+    IF(v_Count <> 0) THEN
+         RAISE_APPLICATION_ERROR(-20000, '@MovementQtyCheck@');
+    END IF;
+    
+END M_INOUTLINE_TRG2
+]]></body>
+    </trigger>
+  </database>
--- a/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -1109,6 +1109,17 @@
 <!--42599C834F074611AF7AF4B638D73342-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--42599C834F074611AF7AF4B638D73342--></AD_AUXILIARINPUT>
 
+<!--47F42EA77ACD4026AF7F41C2D90146C4--><AD_AUXILIARINPUT>
+<!--47F42EA77ACD4026AF7F41C2D90146C4-->  <AD_AUXILIARINPUT_ID><![CDATA[47F42EA77ACD4026AF7F41C2D90146C4]]></AD_AUXILIARINPUT_ID>
+<!--47F42EA77ACD4026AF7F41C2D90146C4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--47F42EA77ACD4026AF7F41C2D90146C4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--47F42EA77ACD4026AF7F41C2D90146C4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--47F42EA77ACD4026AF7F41C2D90146C4-->  <AD_TAB_ID><![CDATA[413]]></AD_TAB_ID>
+<!--47F42EA77ACD4026AF7F41C2D90146C4-->  <NAME><![CDATA[lastNetUnitPrice]]></NAME>
+<!--47F42EA77ACD4026AF7F41C2D90146C4-->  <CODE><![CDATA[0]]></CODE>
+<!--47F42EA77ACD4026AF7F41C2D90146C4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--47F42EA77ACD4026AF7F41C2D90146C4--></AD_AUXILIARINPUT>
+
 <!--485726718FCD47AFB101C59FC1BD365E--><AD_AUXILIARINPUT>
 <!--485726718FCD47AFB101C59FC1BD365E-->  <AD_AUXILIARINPUT_ID><![CDATA[485726718FCD47AFB101C59FC1BD365E]]></AD_AUXILIARINPUT_ID>
 <!--485726718FCD47AFB101C59FC1BD365E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2182,7 +2193,12 @@
 <!--FF80818130F526CB0130F5A6BCC70003-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF80818130F526CB0130F5A6BCC70003-->  <AD_TAB_ID><![CDATA[FF808181308EA4230130901AB2C60090]]></AD_TAB_ID>
 <!--FF80818130F526CB0130F5A6BCC70003-->  <NAME><![CDATA[HASREVERSEDINVOICEPO]]></NAME>
-<!--FF80818130F526CB0130F5A6BCC70003-->  <CODE><![CDATA[@SQL=SELECT 'Y' FROM DUAL WHERE EXISTS (SELECT 1 FROM C_INVOICE_REVERSE WHERE C_INVOICE_ID = @C_Invoice_ID@ )]]></CODE>
+<!--FF80818130F526CB0130F5A6BCC70003-->  <CODE><![CDATA[@SQL=SELECT 'Y' 
+FROM DUAL 
+WHERE EXISTS (SELECT 1 FROM C_INVOICE_REVERSE WHERE C_INVOICE_ID = @C_Invoice_ID@ )
+AND EXISTS (SELECT 1 FROM C_CONVERSION_RATE_DOCUMENT WHERE C_INVOICE_ID = (SELECT REVERSED_C_INVOICE_ID
+                                                                               FROM C_INVOICE_REVERSE
+                                                                               WHERE C_INVOICE_ID = @C_Invoice_ID@))]]></CODE>
 <!--FF80818130F526CB0130F5A6BCC70003-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF80818130F526CB0130F5A6BCC70003--></AD_AUXILIARINPUT>
 
@@ -2193,7 +2209,12 @@
 <!--FF80818130F526CB0130F5A7BC430006-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF80818130F526CB0130F5A7BC430006-->  <AD_TAB_ID><![CDATA[FF808181308EA4230130901D313D00A5]]></AD_TAB_ID>
 <!--FF80818130F526CB0130F5A7BC430006-->  <NAME><![CDATA[HASREVERSEDINVOICESO]]></NAME>
-<!--FF80818130F526CB0130F5A7BC430006-->  <CODE><![CDATA[@SQL=SELECT 'Y' FROM DUAL WHERE EXISTS (SELECT 1 FROM C_INVOICE_REVERSE WHERE C_INVOICE_ID = @C_Invoice_ID@ )]]></CODE>
+<!--FF80818130F526CB0130F5A7BC430006-->  <CODE><![CDATA[@SQL=SELECT 'Y' 
+FROM DUAL 
+WHERE EXISTS (SELECT 1 FROM C_INVOICE_REVERSE WHERE C_INVOICE_ID = @C_Invoice_ID@ )
+AND EXISTS (SELECT 1 FROM C_CONVERSION_RATE_DOCUMENT WHERE C_INVOICE_ID = (SELECT REVERSED_C_INVOICE_ID
+                                                                               FROM C_INVOICE_REVERSE
+                                                                               WHERE C_INVOICE_ID = @C_Invoice_ID@) )]]></CODE>
 <!--FF80818130F526CB0130F5A7BC430006-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF80818130F526CB0130F5A7BC430006--></AD_AUXILIARINPUT>
 
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -28601,8 +28601,8 @@
 <!--C3DA0880F58A707CE040007F01003707-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C3DA0880F58A707CE040007F01003707-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C3DA0880F58A707CE040007F01003707-->  <COLUMNNAME><![CDATA[Costbased]]></COLUMNNAME>
-<!--C3DA0880F58A707CE040007F01003707-->  <NAME><![CDATA[Cost Based Price List]]></NAME>
-<!--C3DA0880F58A707CE040007F01003707-->  <PRINTNAME><![CDATA[Cost Based Price List]]></PRINTNAME>
+<!--C3DA0880F58A707CE040007F01003707-->  <NAME><![CDATA[Price list based on cost]]></NAME>
+<!--C3DA0880F58A707CE040007F01003707-->  <PRINTNAME><![CDATA[Price list based on cost]]></PRINTNAME>
 <!--C3DA0880F58A707CE040007F01003707-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--C3DA0880F58A707CE040007F01003707-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--C3DA0880F58A707CE040007F01003707--></AD_ELEMENT>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Sat Sep 01 00:54:34 2012 +0200
@@ -228785,7 +228785,7 @@
 <!--C3D8F75BFDE52032E040007F01003642-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--C3D8F75BFDE52032E040007F01003642-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C3D8F75BFDE52032E040007F01003642-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--C3D8F75BFDE52032E040007F01003642-->  <NAME><![CDATA[Cost Based Price List]]></NAME>
+<!--C3D8F75BFDE52032E040007F01003642-->  <NAME><![CDATA[Price list based on cost]]></NAME>
 <!--C3D8F75BFDE52032E040007F01003642-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--C3D8F75BFDE52032E040007F01003642-->  <AD_TAB_ID><![CDATA[191]]></AD_TAB_ID>
 <!--C3D8F75BFDE52032E040007F01003642-->  <AD_COLUMN_ID><![CDATA[C3DA0880F548707CE040007F01003707]]></AD_COLUMN_ID>
--- a/src-db/database/sourcedata/AD_MODULE.xml	Fri Aug 31 15:27:48 2012 +0200
+++ b/src-db/database/sourcedata/AD_MODULE.xml	Sat Sep 01 00:54:34 2012 +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.17787]]></VERSION>
+<!--0-->  <VERSION><![CDATA[3.0.17839]]></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>
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateCostingRulesWhenNotCalculatedCosts.class has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdateCostingRulesWhenNotCalculatedCosts.java	Sat Sep 01 00:54:34 2012 +0200
@@ -0,0 +1,51 @@
+/*
+ *************************************************************************
+ * 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) 2012 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.modulescript;
+
+import java.sql.PreparedStatement;
+
+import org.openbravo.database.ConnectionProvider;
+import org.openbravo.modulescript.ModuleScript;
+
+public class UpdateCostingRulesWhenNotCalculatedCosts extends ModuleScript {
+
+  public void execute() {
+    try {
+      String query = " UPDATE m_costing_rule ";
+      query = query + "SET isvalidated = 'N' ";
+      query = query + "WHERE m_costing_rule_id IN ";
+      query = query + "     (SELECT  m_costing_rule_id ";
+      query = query + "      FROM m_costing_rule cr ";
+      query = query + "        JOIN (SELECT ad_org_id, MIN(datefrom) AS startingdate ";
+      query = query + "              FROM m_costing_rule ";
+      query = query + "              GROUP BY ad_org_id) mcr ON cr.ad_org_id = mcr.ad_org_id ";
+      query = query + "      WHERE EXISTS ";
+      query = query + "             (SELECT 1 ";
+      query = query + "              FROM m_transaction trx ";
+      query = query + "              WHERE ad_get_org_le_bu(trx.ad_org_id, 'LE') = cr.ad_org_id ";
+      query = query + "                AND trx.iscostcalculated = 'N' ";
+      query = query + "                AND trxprocessdate < mcr.startingdate)) ";
+      ConnectionProvider cp = getConnectionProvider();
+      PreparedStatement ps = cp.getPreparedStatement(query);
+      ps.executeUpdate();
+    } catch (Exception e) {
+      handleError(e);
+    }
+  }
+}
--- a/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java	Sat Sep 01 00:54:34 2012 +0200
@@ -207,6 +207,10 @@
       OBContext.setAdminMode();
 
       strUserAuth = m_AuthManager.authenticate(request, response);
+      if (strUserAuth == null && "Y".equals(request.getSession().getAttribute("forceLogin"))) {
+        strUserAuth = "0";
+        variables.loggingIn = "Y";
+      }
 
       if (strUserAuth == null) {
         // auth-manager return null after redirecting to the login page -> stop request-processing
@@ -217,6 +221,9 @@
 
       boolean loggedOK = false;
 
+      if ("Y".equals(request.getSession().getAttribute("forceLogin"))) {
+        variables.loggingIn = "Y";
+      }
       // NOTE !isLoggingIn assumes that the value of LoggingIn is N, this
       // is done by the fillSessionArguments below
       if (!variables.isLoggingIn()) {
--- a/src/org/openbravo/costing/CostingBackground.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/src/org/openbravo/costing/CostingBackground.java	Sat Sep 01 00:54:34 2012 +0200
@@ -18,6 +18,7 @@
  */
 package org.openbravo.costing;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -29,7 +30,9 @@
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.plm.Product;
+import org.openbravo.model.materialmgmt.cost.CostingRule;
 import org.openbravo.model.materialmgmt.transaction.MaterialTransaction;
 import org.openbravo.scheduling.ProcessBundle;
 import org.openbravo.scheduling.ProcessLogger;
@@ -51,7 +54,30 @@
     result.setType("Success");
     result.setTitle(OBMessageUtils.messageBD("Success"));
 
-    List<MaterialTransaction> trxs = getTransactionsBatch();
+    // Get organizations with costing rules.
+    StringBuffer where = new StringBuffer();
+    where.append(" as o");
+    where.append(" where exists (");
+    where.append("    select 1 from " + CostingRule.ENTITY_NAME + " as cr");
+    where.append("    where ad_is_orgincluded(o.id, cr." + CostingRule.PROPERTY_ORGANIZATION
+        + ".id, " + CostingRule.PROPERTY_CLIENT + ".id) <> -1 ");
+    where.append("      and cr." + CostingRule.PROPERTY_VALIDATED + " is true");
+    where.append(" )");
+    OBQuery<Organization> orgQry = OBDal.getInstance().createQuery(Organization.class,
+        where.toString());
+    List<Organization> orgs = orgQry.list();
+    List<String> orgsWithRule = new ArrayList<String>();
+    if (orgs.size() == 0) {
+      log4j.debug("No organizations with Cosrting Rule defiend");
+      logger.logln(OBMessageUtils.messageBD("Success"));
+      bundle.setResult(result);
+      return;
+    }
+    for (Organization org : orgs) {
+      orgsWithRule.add(org.getId());
+    }
+
+    List<MaterialTransaction> trxs = getTransactionsBatch(orgsWithRule);
     int counter = 0, total = trxs.size(), batch = 0;
     boolean pendingTrx = trxs.size() > 0;
     while (pendingTrx && counter < maxTransactions) {
@@ -85,15 +111,15 @@
         SessionHandler.getInstance().commitAndStart();
       }
       OBDal.getInstance().getSession().clear();
-      trxs = getTransactionsBatch();
-      pendingTrx = areTransactionsPending();
+      trxs = getTransactionsBatch(orgsWithRule);
+      pendingTrx = areTransactionsPending(orgsWithRule);
       total += trxs.size();
     }
     logger.logln(OBMessageUtils.messageBD("Success"));
     bundle.setResult(result);
   }
 
-  private List<MaterialTransaction> getTransactionsBatch() {
+  private List<MaterialTransaction> getTransactionsBatch(List<String> orgsWithRule) {
     StringBuffer where = new StringBuffer();
     where.append(" as trx");
     where.append(" join trx." + MaterialTransaction.PROPERTY_PRODUCT + " as p");
@@ -102,10 +128,13 @@
     where.append("   and p." + Product.PROPERTY_PRODUCTTYPE + " = 'I'");
     where.append("   and p." + Product.PROPERTY_STOCKED + " = true");
     where.append("   and trx." + MaterialTransaction.PROPERTY_TRANSACTIONPROCESSDATE + " <= :now");
+    where.append("   and trx." + MaterialTransaction.PROPERTY_ORGANIZATION + " in (:orgs)");
     where.append(" order by trx." + MaterialTransaction.PROPERTY_TRANSACTIONPROCESSDATE);
     OBQuery<MaterialTransaction> trxQry = OBDal.getInstance().createQuery(
         MaterialTransaction.class, where.toString());
     trxQry.setNamedParameter("now", new Date());
+    trxQry.setFilterOnReadableOrganization(false);
+    trxQry.setNamedParameter("orgs", orgsWithRule);
 
     if (maxTransactions == 0) {
       maxTransactions = trxQry.count();
@@ -115,7 +144,7 @@
     return trxQry.list();
   }
 
-  private boolean areTransactionsPending() {
+  private boolean areTransactionsPending(List<String> orgsWithRule) {
     StringBuffer where = new StringBuffer();
     where.append(" as trx");
     where.append(" join trx." + MaterialTransaction.PROPERTY_PRODUCT + " as p");
@@ -124,11 +153,14 @@
     where.append("   and p." + Product.PROPERTY_PRODUCTTYPE + " = 'I'");
     where.append("   and p." + Product.PROPERTY_STOCKED + " = true");
     where.append("   and trx." + MaterialTransaction.PROPERTY_TRANSACTIONPROCESSDATE + " <= :now");
+    where.append("   and trx." + MaterialTransaction.PROPERTY_ORGANIZATION + " in (:orgs)");
     where.append(" order by trx." + MaterialTransaction.PROPERTY_TRANSACTIONPROCESSDATE);
     OBQuery<MaterialTransaction> trxQry = OBDal.getInstance().createQuery(
         MaterialTransaction.class, where.toString());
     trxQry.setMaxResult(1);
     trxQry.setNamedParameter("now", new Date());
+    trxQry.setFilterOnReadableOrganization(false);
+    trxQry.setNamedParameter("orgs", orgsWithRule);
 
     return trxQry.list().size() > 0;
   }
--- a/src/org/openbravo/costing/CostingMigrationProcess.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/src/org/openbravo/costing/CostingMigrationProcess.java	Sat Sep 01 00:54:34 2012 +0200
@@ -284,10 +284,11 @@
           updateTrxLegacyCosts(cost, stdPrecission, naturalTree);
 
           if ((i % 100) == 0) {
-            SessionHandler.getInstance().commitAndStart();
+            OBDal.getInstance().flush();
             OBDal.getInstance().getSession().clear();
           }
         }
+        SessionHandler.getInstance().commitAndStart();
       }
     }
 
@@ -350,7 +351,7 @@
         (String) DalUtil.getId(rule.getClient()));
     final Set<String> childOrgs = osp.getChildTree(rule.getOrganization().getId(), true);
     CostingRuleProcess crp = new CostingRuleProcess();
-    crp.createCostingRuleInits(rule, childOrgs);
+    crp.createCostingRuleInits(rule.getId(), childOrgs, null);
 
     // Set valid from date
     Date startingDate = new Date();
@@ -585,9 +586,9 @@
         // Shipments with accounting date different than the movement date gets the cost valid on
         // the accounting date.
         BigDecimal unitCost = new BigDecimal(new ProductInfo(cost.getProduct().getId(),
-            new DalConnectionProvider()).getProductItemCost(OBDateUtils.formatDate(trx
+            new DalConnectionProvider(false)).getProductItemCost(OBDateUtils.formatDate(trx
             .getGoodsShipmentLine().getShipmentReceipt().getAccountingDate()), null, "AV",
-            new DalConnectionProvider(), OBDal.getInstance().getConnection()));
+            new DalConnectionProvider(false), OBDal.getInstance().getConnection()));
         BigDecimal trxCost = unitCost.multiply(trx.getMovementQuantity().abs()).setScale(
             standardPrecision, BigDecimal.ROUND_HALF_UP);
 
--- a/src/org/openbravo/costing/CostingRuleProcess.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/src/org/openbravo/costing/CostingRuleProcess.java	Sat Sep 01 00:54:34 2012 +0200
@@ -22,15 +22,16 @@
 import java.math.RoundingMode;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.lang.time.DateUtils;
 import org.apache.log4j.Logger;
 import org.hibernate.Query;
-import org.hibernate.dialect.function.StandardSQLFunction;
-import org.hibernate.type.DateType;
-import org.hibernate.type.StringType;
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.dal.core.DalUtil;
@@ -42,15 +43,18 @@
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.financial.FinancialUtils;
 import org.openbravo.materialmgmt.InventoryCountProcess;
-import org.openbravo.model.ad.access.User;
+import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Locator;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.enterprise.Warehouse;
+import org.openbravo.model.common.plm.AttributeSetInstance;
 import org.openbravo.model.common.plm.Product;
+import org.openbravo.model.common.plm.ProductUOM;
+import org.openbravo.model.common.uom.UOM;
 import org.openbravo.model.materialmgmt.cost.CostingRule;
 import org.openbravo.model.materialmgmt.cost.CostingRuleInit;
-import org.openbravo.model.materialmgmt.onhandquantity.StorageDetail;
+import org.openbravo.model.materialmgmt.cost.TransactionCost;
 import org.openbravo.model.materialmgmt.transaction.InventoryCount;
 import org.openbravo.model.materialmgmt.transaction.InventoryCountLine;
 import org.openbravo.model.materialmgmt.transaction.MaterialTransaction;
@@ -71,8 +75,8 @@
     msg.setTitle(OBMessageUtils.messageBD("Success"));
     try {
       OBContext.setAdminMode(false);
-      final String recordID = (String) bundle.getParams().get("M_Costing_Rule_ID");
-      final CostingRule rule = OBDal.getInstance().get(CostingRule.class, recordID);
+      final String ruleId = (String) bundle.getParams().get("M_Costing_Rule_ID");
+      CostingRule rule = OBDal.getInstance().get(CostingRule.class, ruleId);
 
       OrganizationStructureProvider osp = OBContext.getOBContext()
           .getOrganizationStructureProvider(rule.getClient().getId());
@@ -90,43 +94,34 @@
         // Product configured to have cost not calculated cannot have transactions with cost
         // calculated.
         checkNoTrxWithCostCalculated(naturalOrgs, childOrgs);
+        if (rule.getStartingDate() != null) {
+          // First rule of an instance that does not need migration. Old transactions costs are not
+          // calculated. They are initialized with ZERO cost.
+          initializeOldTrx(childOrgs, rule.getStartingDate());
+        }
       }
-      // Inventories are only needed if the costing rule is updating a previous rule or legacy cost
-      // engine was used.
-      if (existsPreviousRule) {
-        createCostingRuleInits(rule, childOrgs);
-        // Set valid from date
-        Date startingDate = DateUtils.truncate(new Date(), Calendar.SECOND);
-        rule.setStartingDate(startingDate);
-        log4j.debug("setting starting date " + startingDate);
-        OBDal.getInstance().flush();
+      // Inventories are only needed:
+      // - if the costing rule is updating a previous rule
+      // - or legacy cost was never used and the first validated rule has a starting date different
+      // than null. If the date is old enough that there are not prior transactions no inventories
+      // are created.
+      if (existsPreviousRule || rule.getStartingDate() != null) {
+        Date startingDate = rule.getStartingDate();
+        if (existsPreviousRule) {
+          // Set valid from date
+          startingDate = DateUtils.truncate(new Date(), Calendar.SECOND);
+          rule.setStartingDate(startingDate);
+          log4j.debug("setting starting date " + startingDate);
+          OBDal.getInstance().flush();
+        }
+        createCostingRuleInits(ruleId, childOrgs, startingDate);
 
         // Update cost of inventories and process starting physical inventories.
-        for (CostingRuleInit cri : rule.getCostingRuleInitList()) {
-          for (InventoryCountLine icl : cri.getCloseInventory()
-              .getMaterialMgmtInventoryCountLineList()) {
-            MaterialTransaction trx = getInventoryLineTransaction(icl);
-            // Remove 1 second from transaction date to ensure that cost is calculated with previous
-            // costing rule.
-            trx.setTransactionProcessDate(DateUtils.addSeconds(startingDate, -1));
-            Currency cur = FinancialUtils.getLegalEntityCurrency(trx.getOrganization());
-            BigDecimal trxCost = CostingUtils.getTransactionCost(trx, startingDate, true, cur);
-            BigDecimal cost = trxCost.divide(trx.getMovementQuantity().abs(), cur
-                .getCostingPrecision().intValue(), RoundingMode.HALF_UP);
-
-            trx.setCostCalculated(true);
-            trx.setCostingStatus("CC");
-            trx.setTransactionCost(trxCost);
-            OBDal.getInstance().save(trx);
-            InventoryCountLine initICL = getInitIcl(cri.getInitInventory(), icl);
-            initICL.setCost(cost);
-            OBDal.getInstance().save(initICL);
-          }
-          OBDal.getInstance().flush();
-          new InventoryCountProcess().processInventory(cri.getInitInventory());
-        }
+        updateInventoriesCostAndProcessInitInventories(ruleId, startingDate, existsPreviousRule);
       }
 
+      // Reload rule after possible session clear.
+      rule = OBDal.getInstance().get(CostingRule.class, ruleId);
       rule.setValidated(true);
       CostingStatus.getInstance().setMigrated();
       OBDal.getInstance().save(rule);
@@ -205,10 +200,11 @@
     where.append(" as p");
     where.append(" where p." + Product.PROPERTY_PRODUCTTYPE + " = 'I'");
     where.append("  and p." + Product.PROPERTY_STOCKED + " = true");
-    where.append("  and p." + Product.PROPERTY_ORGANIZATION + ".id in :porgs");
+    where.append("  and p." + Product.PROPERTY_ORGANIZATION + ".id in (:porgs)");
     where.append("  and exists (select 1 from " + MaterialTransaction.ENTITY_NAME + " as trx ");
     where.append("   where trx." + MaterialTransaction.PROPERTY_PRODUCT + " = p");
-    where.append("     and trx." + MaterialTransaction.PROPERTY_ORGANIZATION + ".id in :childOrgs");
+    where.append("     and trx." + MaterialTransaction.PROPERTY_ORGANIZATION
+        + ".id in (:childOrgs)");
     where.append("     and trx." + MaterialTransaction.PROPERTY_ISCOSTCALCULATED + " = false");
     where.append("   )");
     OBQuery<Product> pQry = OBDal.getInstance().createQuery(Product.class, where.toString());
@@ -225,11 +221,12 @@
     where.append(" as p");
     where.append(" where p." + Product.PROPERTY_PRODUCTTYPE + " = 'I'");
     where.append("  and p." + Product.PROPERTY_STOCKED + " = true");
-    where.append("  and p." + Product.PROPERTY_ORGANIZATION + ".id in :porgs");
+    where.append("  and p." + Product.PROPERTY_ORGANIZATION + ".id in (:porgs)");
     where.append("  and exists (select 1 from " + MaterialTransaction.ENTITY_NAME + " as trx ");
     where.append("   where trx." + MaterialTransaction.PROPERTY_PRODUCT + " = p");
     where.append("     and trx." + MaterialTransaction.PROPERTY_ISCOSTCALCULATED + " = true");
-    where.append("     and trx." + MaterialTransaction.PROPERTY_ORGANIZATION + ".id in :childOrgs");
+    where.append("     and trx." + MaterialTransaction.PROPERTY_ORGANIZATION
+        + ".id in (:childOrgs)");
     where.append("   )");
     OBQuery<Product> pQry = OBDal.getInstance().createQuery(Product.class, where.toString());
     pQry.setFilterOnReadableOrganization(false);
@@ -240,155 +237,257 @@
     }
   }
 
+  private void initializeOldTrx(Set<String> childOrgs, Date date) {
+    StringBuffer where = new StringBuffer();
+    where.append(" where " + MaterialTransaction.PROPERTY_ORGANIZATION + ".id in (:orgs)");
+    where.append("   and " + MaterialTransaction.PROPERTY_TRANSACTIONPROCESSDATE + " < :date");
+    OBQuery<MaterialTransaction> trxQry = OBDal.getInstance().createQuery(
+        MaterialTransaction.class, where.toString());
+    trxQry.setFilterOnReadableOrganization(false);
+    trxQry.setNamedParameter("orgs", childOrgs);
+    trxQry.setNamedParameter("date", date);
+    trxQry.setFetchSize(1000);
+    ScrollableResults trxs = trxQry.scroll(ScrollMode.FORWARD_ONLY);
+    int i = 1;
+    while (trxs.next()) {
+      MaterialTransaction trx = (MaterialTransaction) trxs.get(0);
+
+      TransactionCost transactionCost = OBProvider.getInstance().get(TransactionCost.class);
+      transactionCost.setInventoryTransaction(trx);
+      transactionCost.setCostDate(trx.getTransactionProcessDate());
+      transactionCost.setClient(trx.getClient());
+      transactionCost.setOrganization(trx.getOrganization());
+      transactionCost.setCost(BigDecimal.ZERO);
+      transactionCost.setCurrency(trx.getClient().getCurrency());
+      List<TransactionCost> trxCosts = trx.getTransactionCostList();
+      trxCosts.add(transactionCost);
+      trx.setTransactionCostList(trxCosts);
+
+      trx.setCostCalculated(true);
+      trx.setCostingStatus("CC");
+      trx.setTransactionCost(BigDecimal.ZERO);
+      trx.setCurrency(trx.getClient().getCurrency());
+      OBDal.getInstance().save(trx);
+
+      if ((i % 100) == 0) {
+        OBDal.getInstance().flush();
+        OBDal.getInstance().getSession().clear();
+      }
+      i++;
+    }
+  }
+
+  @Deprecated
   protected void createCostingRuleInits(CostingRule rule, Set<String> childOrgs) {
-    // Create inventories.
-    List<Object[]> whorgl = getWarehouseAndOrgsWithStock(childOrgs);
-    for (Object[] record : whorgl) {
-      // Warehouse wh = OBDal.getInstance().get(Warehouse.class, record[0]);
-      createPhysicalInventories((String) record[1], (Warehouse) record[0], rule);
+    createCostingRuleInits(rule.getId(), childOrgs, null);
+  }
+
+  protected void createCostingRuleInits(String ruleId, Set<String> childOrgs, Date date) {
+    CostingRule rule = OBDal.getInstance().get(CostingRule.class, ruleId);
+    ScrollableResults stockLines = getStockLines(childOrgs, date);
+    // The key of the Map is the concatenation of orgId and warehouseId
+    Map<String, String> initLines = new HashMap<String, String>();
+    Map<String, Long> maxLineNumbers = new HashMap<String, Long>();
+    int i = 1;
+    while (stockLines.next()) {
+      Object[] stockLine = stockLines.get();
+      String productId = (String) stockLine[0];
+      String attrSetInsId = (String) stockLine[1];
+      String uomId = (String) stockLine[2];
+      String orderUOMId = (String) stockLine[3];
+      String locatorId = (String) stockLine[4];
+      String warehouseId = (String) stockLine[5];
+      BigDecimal qty = (BigDecimal) stockLine[6];
+      BigDecimal orderQty = (BigDecimal) stockLine[7];
+
+      String criId = initLines.get(warehouseId);
+      CostingRuleInit cri = null;
+      if (criId == null) {
+        cri = createCostingRuleInitLine(rule, warehouseId, date);
+
+        initLines.put(warehouseId, cri.getId());
+      } else {
+        cri = OBDal.getInstance().get(CostingRuleInit.class, criId);
+      }
+      Long lineNo = (maxLineNumbers.get(criId) == null ? 0L : maxLineNumbers.get(criId)) + 10L;
+      maxLineNumbers.put(criId, lineNo);
+
+      insertInventoryLine(cri.getCloseInventory(), productId, attrSetInsId, uomId, orderUOMId,
+          locatorId, BigDecimal.ZERO, qty, BigDecimal.ZERO, orderQty, lineNo);
+      insertInventoryLine(cri.getInitInventory(), productId, attrSetInsId, uomId, orderUOMId,
+          locatorId, qty, BigDecimal.ZERO, orderQty, BigDecimal.ZERO, lineNo);
+
+      if ((i % 100) == 0) {
+        OBDal.getInstance().flush();
+        OBDal.getInstance().getSession().clear();
+        // Reload rule after clear session.
+        rule = OBDal.getInstance().get(CostingRule.class, ruleId);
+      }
+      i++;
     }
-
     // Process closing physical inventories.
     for (CostingRuleInit cri : rule.getCostingRuleInitList()) {
       new InventoryCountProcess().processInventory(cri.getCloseInventory());
     }
   }
 
-  @SuppressWarnings("unchecked")
-  private List<Object[]> getWarehouseAndOrgsWithStock(Set<String> orgs) {
+  private ScrollableResults getStockLines(Set<String> childOrgs, Date date) {
     StringBuffer select = new StringBuffer();
-    select.append(" select distinct");
-    select.append(" locator." + Locator.PROPERTY_WAREHOUSE);
-    select.append(", sd." + StorageDetail.PROPERTY_ORGANIZATION + ".id");
-    select.append("\n from " + StorageDetail.ENTITY_NAME + " as sd");
-    select.append("   join sd." + StorageDetail.PROPERTY_STORAGEBIN + " as locator");
-    select.append("   join sd." + StorageDetail.PROPERTY_PRODUCT + " as p");
-    select.append("\n where sd." + StorageDetail.PROPERTY_ORGANIZATION + ".id in (:orgs)");
-    select.append("   and (sd." + StorageDetail.PROPERTY_QUANTITYONHAND + " <> 0");
-    select.append("        or sd." + StorageDetail.PROPERTY_ONHANDORDERQUANITY + " <> 0)");
-    select.append("   and p." + Product.PROPERTY_PRODUCTTYPE + " = 'I'");
-    select.append("   and p." + Product.PROPERTY_STOCKED + " = true");
-    Query querySelect = OBDal.getInstance().getSession().createQuery(select.toString());
-    querySelect.setParameterList("orgs", orgs);
-    return querySelect.list();
+    select.append("select trx." + MaterialTransaction.PROPERTY_PRODUCT + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_ATTRIBUTESETVALUE + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_UOM + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_ORDERUOM + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_STORAGEBIN + ".id");
+    select.append(", loc." + Locator.PROPERTY_WAREHOUSE + ".id");
+    select.append(", sum(trx." + MaterialTransaction.PROPERTY_MOVEMENTQUANTITY + ")");
+    select.append(", sum(trx." + MaterialTransaction.PROPERTY_ORDERQUANTITY + ")");
+    select.append(" from " + MaterialTransaction.ENTITY_NAME + " as trx");
+    select.append("    join trx." + MaterialTransaction.PROPERTY_STORAGEBIN + " as loc");
+    select.append(" where trx." + MaterialTransaction.PROPERTY_ORGANIZATION + ".id in (:orgs)");
+    select.append("   and trx." + MaterialTransaction.PROPERTY_MOVEMENTDATE + " < :date");
+    select.append(" group by trx." + MaterialTransaction.PROPERTY_PRODUCT + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_ATTRIBUTESETVALUE + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_UOM + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_ORDERUOM + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_STORAGEBIN + ".id");
+    select.append(", loc." + Locator.PROPERTY_WAREHOUSE + ".id");
+    select.append(" having ");
+    select.append(" sum(trx." + MaterialTransaction.PROPERTY_MOVEMENTQUANTITY + ") <> 0");
+    select.append(" or sum(trx." + MaterialTransaction.PROPERTY_ORDERQUANTITY + ") <> 0");
+    select.append(" order by loc." + Locator.PROPERTY_WAREHOUSE + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_PRODUCT + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_STORAGEBIN + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_ATTRIBUTESETVALUE + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_UOM + ".id");
+    select.append(", trx." + MaterialTransaction.PROPERTY_ORDERUOM + ".id");
+
+    Query stockLinesQry = OBDal.getInstance().getSession().createQuery(select.toString());
+    stockLinesQry.setParameterList("orgs", childOrgs);
+    stockLinesQry.setDate("date", date);
+    stockLinesQry.setFetchSize(1000);
+    ScrollableResults stockLines = stockLinesQry.scroll(ScrollMode.FORWARD_ONLY);
+    return stockLines;
   }
 
-  private void createPhysicalInventories(String orgId, Warehouse wh, CostingRule rule) {
-    Organization org = OBDal.getInstance().get(Organization.class, orgId);
+  private CostingRuleInit createCostingRuleInitLine(CostingRule rule, String warehouseId, Date date) {
+    String clientId = (String) DalUtil.getId(rule.getClient());
+    String orgId = (String) DalUtil.getId(rule.getOrganization());
     CostingRuleInit cri = OBProvider.getInstance().get(CostingRuleInit.class);
-    cri.setClient(org.getClient());
-    cri.setOrganization(org);
-    cri.setWarehouse(wh);
+    cri.setClient((Client) OBDal.getInstance().getProxy(Client.ENTITY_NAME, clientId));
+    cri.setOrganization((Organization) OBDal.getInstance()
+        .getProxy(Organization.ENTITY_NAME, orgId));
+    cri.setWarehouse((Warehouse) OBDal.getInstance().getProxy(Warehouse.ENTITY_NAME, warehouseId));
     cri.setCostingRule(rule);
     List<CostingRuleInit> criList = rule.getCostingRuleInitList();
     criList.add(cri);
     rule.setCostingRuleInitList(criList);
 
     InventoryCount closeInv = OBProvider.getInstance().get(InventoryCount.class);
-    closeInv.setClient(org.getClient());
-    closeInv.setOrganization(org);
+    closeInv.setClient((Client) OBDal.getInstance().getProxy(Client.ENTITY_NAME, clientId));
+    closeInv.setOrganization((Organization) OBDal.getInstance().getProxy(Organization.ENTITY_NAME,
+        orgId));
     closeInv.setName(OBMessageUtils.messageBD("CostCloseInventory"));
-    closeInv.setWarehouse(wh);
-    closeInv.setMovementDate(new Date());
+    closeInv.setWarehouse((Warehouse) OBDal.getInstance().getProxy(Warehouse.ENTITY_NAME,
+        warehouseId));
+    closeInv.setMovementDate(date);
     cri.setCloseInventory(closeInv);
 
     InventoryCount initInv = OBProvider.getInstance().get(InventoryCount.class);
-    initInv.setClient(org.getClient());
-    initInv.setOrganization(org);
+    initInv.setClient((Client) OBDal.getInstance().getProxy(Client.ENTITY_NAME, clientId));
+    initInv.setOrganization((Organization) OBDal.getInstance().getProxy(Organization.ENTITY_NAME,
+        orgId));
     initInv.setName(OBMessageUtils.messageBD("CostInitInventory"));
-    initInv.setWarehouse(wh);
-    initInv.setMovementDate(new Date());
+    initInv.setWarehouse((Warehouse) OBDal.getInstance().getProxy(Warehouse.ENTITY_NAME,
+        warehouseId));
+    initInv.setMovementDate(date);
     cri.setInitInventory(initInv);
     OBDal.getInstance().save(rule);
     OBDal.getInstance().save(closeInv);
     OBDal.getInstance().save(initInv);
-    OBDal.getInstance().flush();
-    insertLines(closeInv, true, orgId, wh.getId());
-    insertLines(initInv, false, orgId, wh.getId());
-    OBDal.getInstance().refresh(closeInv);
-    OBDal.getInstance().refresh(initInv);
 
     OBDal.getInstance().flush();
+
+    return cri;
   }
 
-  private void insertLines(InventoryCount closeInv, boolean isClosing, String orgId, String whId) {
-    // In case get_uuid is not already registered, it's registered now.
-    OBDal.getInstance().registerSQLFunction("get_uuid",
-        new StandardSQLFunction("get_uuid", new StringType()));
-    OBDal.getInstance().registerSQLFunction("now", new StandardSQLFunction("now", new DateType()));
+  private void insertInventoryLine(InventoryCount inventory, String productId, String attrSetInsId,
+      String uomId, String orderUOMId, String locatorId, BigDecimal qtyCount, BigDecimal qtyBook,
+      BigDecimal orderQtyCount, BigDecimal orderQtyBook, Long lineNo) {
+    InventoryCountLine icl = OBProvider.getInstance().get(InventoryCountLine.class);
+    icl.setClient(inventory.getClient());
+    icl.setOrganization(inventory.getOrganization());
+    icl.setPhysInventory(inventory);
+    icl.setLineNo(lineNo);
+    icl.setStorageBin((Locator) OBDal.getInstance().getProxy(Locator.ENTITY_NAME, locatorId));
+    icl.setProduct((Product) OBDal.getInstance().getProxy(Product.ENTITY_NAME, productId));
+    icl.setAttributeSetValue((AttributeSetInstance) OBDal.getInstance().getProxy(
+        AttributeSetInstance.ENTITY_NAME, attrSetInsId));
+    icl.setQuantityCount(qtyCount);
+    icl.setBookQuantity(qtyBook);
+    icl.setUOM((UOM) OBDal.getInstance().getProxy(UOM.ENTITY_NAME, uomId));
+    if (orderUOMId != null) {
+      icl.setOrderQuantity(orderQtyCount);
+      icl.setQuantityOrderBook(orderQtyBook);
+      icl.setOrderUOM((ProductUOM) OBDal.getInstance().getProxy(ProductUOM.ENTITY_NAME, orderUOMId));
+    }
 
-    // FIXME: Insert should be done with a loop based on scroll.
-    StringBuffer insert = new StringBuffer();
-    insert.append("insert into " + InventoryCountLine.ENTITY_NAME + "(");
-    insert.append(" id ");
-    insert.append(", " + InventoryCountLine.PROPERTY_ACTIVE);
-    insert.append(", " + InventoryCountLine.PROPERTY_CLIENT);
-    insert.append(", " + InventoryCountLine.PROPERTY_ORGANIZATION);
-    insert.append(", " + InventoryCountLine.PROPERTY_CREATIONDATE);
-    insert.append(", " + InventoryCountLine.PROPERTY_CREATEDBY);
-    insert.append(", " + InventoryCountLine.PROPERTY_UPDATED);
-    insert.append(", " + InventoryCountLine.PROPERTY_UPDATEDBY);
-    insert.append(", " + InventoryCountLine.PROPERTY_PHYSINVENTORY);
-    insert.append(", " + InventoryCountLine.PROPERTY_LINENO);
-    insert.append(", " + InventoryCountLine.PROPERTY_STORAGEBIN);
-    insert.append(", " + InventoryCountLine.PROPERTY_PRODUCT);
-    insert.append(", " + InventoryCountLine.PROPERTY_ATTRIBUTESETVALUE);
-    insert.append(", " + InventoryCountLine.PROPERTY_QUANTITYCOUNT);
-    insert.append(", " + InventoryCountLine.PROPERTY_BOOKQUANTITY);
-    insert.append(", " + InventoryCountLine.PROPERTY_ORDERQUANTITY);
-    insert.append(", " + InventoryCountLine.PROPERTY_QUANTITYORDERBOOK);
-    insert.append(", " + InventoryCountLine.PROPERTY_UOM);
-    insert.append(", " + InventoryCountLine.PROPERTY_ORDERUOM);
-    insert.append(" )\n select get_uuid()");
-    insert.append(", sd." + StorageDetail.PROPERTY_ACTIVE);
-    insert.append(", sd." + StorageDetail.PROPERTY_CLIENT);
-    insert.append(", sd." + StorageDetail.PROPERTY_ORGANIZATION);
-    insert.append(", now()");
-    insert.append(", u");
-    insert.append(", now()");
-    insert.append(", u");
-    insert.append(", inv");
-    insert.append(", 10L");
-    insert.append(", locator");
-    insert.append(", p");
-    insert.append(", sd." + StorageDetail.PROPERTY_ATTRIBUTESETVALUE);
-    if (isClosing) {
-      // Closing inventories set qty count to zero to empty the stock
-      // O is multiplied to force a cast to BigDecimal
-      insert.append(", 0 * sd." + StorageDetail.PROPERTY_QUANTITYONHAND);
-      insert.append(", sd." + StorageDetail.PROPERTY_QUANTITYONHAND);
-      insert.append(", 0 * sd." + StorageDetail.PROPERTY_ONHANDORDERQUANITY);
-      insert.append(", sd." + StorageDetail.PROPERTY_ONHANDORDERQUANITY);
-    } else {
-      // Init inventories set qty book to zero to restore the stock
-      // O is multiplied to force a cast to BigDecimal
-      insert.append(", sd." + StorageDetail.PROPERTY_QUANTITYONHAND);
-      insert.append(", 0 * sd." + StorageDetail.PROPERTY_QUANTITYONHAND);
-      insert.append(", sd." + StorageDetail.PROPERTY_ONHANDORDERQUANITY);
-      insert.append(", 0 * sd." + StorageDetail.PROPERTY_ONHANDORDERQUANITY);
+    List<InventoryCountLine> invLines = inventory.getMaterialMgmtInventoryCountLineList();
+    invLines.add(icl);
+    inventory.setMaterialMgmtInventoryCountLineList(invLines);
+    OBDal.getInstance().save(inventory);
+    OBDal.getInstance().flush();
+
+  }
+
+  private void updateInventoriesCostAndProcessInitInventories(String ruleId, Date startingDate,
+      boolean existsPreviousRule) {
+    CostingRule rule = OBDal.getInstance().get(CostingRule.class, ruleId);
+    for (CostingRuleInit cri : rule.getCostingRuleInitList()) {
+      for (InventoryCountLine icl : cri.getCloseInventory().getMaterialMgmtInventoryCountLineList()) {
+        MaterialTransaction trx = getInventoryLineTransaction(icl);
+        // Remove 1 second from transaction date to ensure that cost is calculated with previous
+        // costing rule.
+        trx.setTransactionProcessDate(DateUtils.addSeconds(startingDate, -1));
+        BigDecimal trxCost = BigDecimal.ZERO;
+        BigDecimal cost = null;
+        if (existsPreviousRule) {
+          Currency cur = FinancialUtils.getLegalEntityCurrency(trx.getOrganization());
+
+          trxCost = CostingUtils.getTransactionCost(trx, startingDate, true, cur);
+          if (trx.getMovementQuantity().compareTo(BigDecimal.ZERO) != 0) {
+            cost = trxCost.divide(trx.getMovementQuantity().abs(), cur.getCostingPrecision()
+                .intValue(), RoundingMode.HALF_UP);
+          }
+        } else {
+          // Insert transaction cost record big ZERO cost.
+          TransactionCost transactionCost = OBProvider.getInstance().get(TransactionCost.class);
+          transactionCost.setInventoryTransaction(trx);
+          transactionCost.setCostDate(trx.getTransactionProcessDate());
+          transactionCost.setClient(trx.getClient());
+          transactionCost.setOrganization(trx.getOrganization());
+          transactionCost.setCost(BigDecimal.ZERO);
+          transactionCost.setCurrency(trx.getClient().getCurrency());
+          List<TransactionCost> trxCosts = trx.getTransactionCostList();
+          trxCosts.add(transactionCost);
+          trx.setTransactionCostList(trxCosts);
+          OBDal.getInstance().save(trx);
+        }
+
+        trx.setCostCalculated(true);
+        trx.setCostingStatus("CC");
+        trx.setCurrency(trx.getClient().getCurrency());
+        trx.setTransactionCost(trxCost);
+        OBDal.getInstance().save(trx);
+        InventoryCountLine initICL = getInitIcl(cri.getInitInventory(), icl);
+        initICL.setCost(cost);
+        OBDal.getInstance().save(initICL);
+      }
+      OBDal.getInstance().flush();
+      new InventoryCountProcess().processInventory(cri.getInitInventory());
     }
-    insert.append(", sd." + StorageDetail.PROPERTY_UOM);
-    insert.append(", sd." + StorageDetail.PROPERTY_ORDERUOM);
-    insert.append("\n from " + StorageDetail.ENTITY_NAME + " as sd");
-    insert.append("   join sd." + StorageDetail.PROPERTY_STORAGEBIN + " as locator");
-    insert.append("   join sd." + StorageDetail.PROPERTY_PRODUCT + " as p");
-    insert.append(", " + User.ENTITY_NAME + " as u");
-    insert.append(", " + InventoryCount.ENTITY_NAME + " as inv");
-    insert.append("\n where sd." + StorageDetail.PROPERTY_ORGANIZATION + ".id = :orgId");
-    insert.append("   and locator." + Locator.PROPERTY_WAREHOUSE + ".id = :wh");
-    insert.append("   and (sd." + StorageDetail.PROPERTY_QUANTITYONHAND + " <> 0");
-    insert.append("    or sd." + StorageDetail.PROPERTY_ONHANDORDERQUANITY + " <> 0)");
-    insert.append("   and p." + Product.PROPERTY_PRODUCTTYPE + " = 'I'");
-    insert.append("   and p." + Product.PROPERTY_STOCKED + " = true");
-    insert.append("   and inv.id = :inv");
-    insert.append("   and u.id = :user");
-    // insert.append("\n order by p." + Product.PROPERTY_NAME);
-    Query queryInsert = OBDal.getInstance().getSession().createQuery(insert.toString());
-    queryInsert.setString("orgId", orgId);
-    queryInsert.setString("wh", whId);
-    queryInsert.setString("inv", closeInv.getId());
-    queryInsert.setString("user", (String) DalUtil.getId(OBContext.getOBContext().getUser()));
-    queryInsert.executeUpdate();
+    if (!existsPreviousRule) {
+      updateInitInventoriesTrxDate(startingDate, ruleId);
+    }
   }
 
   protected MaterialTransaction getInventoryLineTransaction(InventoryCountLine icl) {
@@ -426,4 +525,30 @@
     }
     return iclQry.uniqueResult();
   }
+
+  private void updateInitInventoriesTrxDate(Date startingDate, String ruleId) {
+    StringBuffer where = new StringBuffer();
+    where.append(" as trx");
+    where.append("   join trx." + MaterialTransaction.PROPERTY_PHYSICALINVENTORYLINE + " as il");
+    where.append(" where il." + InventoryCountLine.PROPERTY_PHYSINVENTORY + ".id IN (");
+    where.append("    select cri." + CostingRuleInit.PROPERTY_INITINVENTORY + ".id");
+    where.append("    from " + CostingRuleInit.ENTITY_NAME + " as cri");
+    where.append("    where cri." + CostingRuleInit.PROPERTY_COSTINGRULE + ".id = :cr");
+    where.append("    )");
+    OBQuery<MaterialTransaction> trxQry = OBDal.getInstance().createQuery(
+        MaterialTransaction.class, where.toString());
+    trxQry.setNamedParameter("cr", ruleId);
+    trxQry.setFetchSize(1000);
+    ScrollableResults trxs = trxQry.scroll(ScrollMode.FORWARD_ONLY);
+    int i = 0;
+    while (trxs.next()) {
+      MaterialTransaction trx = (MaterialTransaction) trxs.get(0);
+      trx.setTransactionProcessDate(startingDate);
+      OBDal.getInstance().save(trx);
+      if ((i % 100) == 0) {
+        OBDal.getInstance().flush();
+        OBDal.getInstance().getSession().clear();
+      }
+    }
+  }
 }
--- a/src/org/openbravo/erpCommon/ad_actionButton/MRPManufacturingPlanProcess.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/MRPManufacturingPlanProcess.java	Sat Sep 01 00:54:34 2012 +0200
@@ -178,6 +178,7 @@
         where.toString());
     prlQry.setNamedParameter("prodRun", productionRunId);
 
+    prlQry.setFetchSize(1000);
     return prlQry.scroll(ScrollMode.FORWARD_ONLY);
   }
 
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Expense_Product.java	Fri Aug 31 15:27:48 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Expense_Product.java	Sat Sep 01 00:54:34 2012 +0200
@@ -54,10 +54,16 @@
       String strChanged = vars.getStringParameter("inpLastFieldChanged");
       String strTabId = vars.getStringParameter("inpTabId");
       String strInvPrice = vars.getNumericParameter("inpinvoiceprice");
+      String strWindowId = vars.getStringParameter("inpwindowId");
+      String strlastNetUnitPrice = vars.getNumericGlobalVariable("inplastNetUnitPrice", strWindowId
+          + "|lastNetUnitPrice", "0");
 
+      if (strlastNetUnitPrice.equals("0")) {
+        strlastNetUnitPrice = strInvPrice;
+      }
       try {
         printPage(response, vars, strDateexpense, strmProductId, strsTimeexpenseId, strqty,
-            strcCurrencyId, strInvPrice, strChanged, strTabId);
+            strcCurrencyId, strInvPrice, strChanged, strTabId, strWindowId, strlastNetUnitPrice);
       } catch (ServletException ex) {
         pageErrorCallOut(response);
       }
@@ -67,8 +73,8 @@
 
   private void printPage(HttpServletResponse response, VariablesSecureApp vars,
       String strDateexpense, String strmProductId, String strsTimeexpenseId, String strqty,
-      String strcCurrencyId, String strInvPrice, String strChanged, String strTabId)
-      throws IOException, ServletException {
+      String strcCurrencyId, String strInvPrice, String strChanged, String strTabId,
+      String strWindowId, String strlastNetUnitPrice) throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
@@ -88,7 +94,8 @@
           .today(this) : SEExpenseProductData.selectReportDate(this, strsTimeexpenseId);
     }
 
-    if (strInvPrice.equals("")) {
+    if (strInvPrice.equals("")
+        || (strChanged.equals("inpmProductId") && strInvPrice.equals(strlastNetUnitPrice))) {
       for (int i = 0; data != null && i < data.length && noPrice; i++) {
         if (data[i].validfrom == null || data[i].validfrom.equals("")
             || !DateTimeData.compare(this, strDateexpense, data[i].validfrom).equals("-1")) {
@@ -120,6 +127,7 @@
           }
         }
       }
+      vars.setSessionValue(strWindowId + "|lastNetUnitPrice", priceActual);
     } else {
       priceActual = strInvPrice;
     }
--- a/src/org/openbravo/erpCommon/ad_reports/ReportProductionCost_data.xsql	Fri Aug 31 15:27:48 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportProductionCost_data.xsql	Sat Sep 01 00:54:34 2012 +0200
@@ -75,20 +75,22 @@
        SELECT auxSeq.M_Product_ID AS ID, M_Product.Name, 
         SUM(auxSeq.ComponentCost*auxSeq.ConsumedQty)/SUM(auxSeq.ProducedQty) AS ConsumedPerUnit, 
         SUM(auxSeq.TotalRealCost)/SUM(auxSeq.ConsumedQty) AS CostPerUnit,
-        SUM(auxSeq.ComponentCost*sp.Quantity)/SUM(sp.Quantity) AS ConsumedPerUnitStd, 
+        SUM(auxSeq.ComponentCost*sp.Quantity)/SUM(auxSeq.ProducedStdQuantity) * SUM(Coalesce(sp.decrease,1)) * SUM(coalesce(sp.rejected,1)) AS ConsumedPerUnitStd, 
         MAX(C_CURRENCY_CONVERT(sp.Cost, ?, ?, TO_DATE(sp.Updated), null, sp.ad_client_id, sp.ad_org_id)) AS CostPerUnitStd, 
             to_char(?)||to_char(auxSeq.M_Product_ID) as identifier, to_char((to_number(?)+1)*5) as level_blanck, to_char(40-((to_number(?)+1)*5)) as level_name, case when M_Product.MA_ProcessPlan_ID is null then '' else 'datawarehouseclose' end as button_class, to_char(to_number(?)+1) as levelid
         FROM 
           (SELECT rpn.M_Product_ID, rpp.ComponentCost, SUM(rpn.ConsumedQty) AS ConsumedQty, 
-           SUM(rpp.ProducedQty) AS ProducedQty, SUM(rpn.ConsumedQty*rpn.CalcCost) AS TotalRealCost, rpp.MA_Sequence_ID
+           SUM(rpp.ProducedQty) AS ProducedQty, SUM(rpn.ConsumedQty*rpn.CalcCost) AS TotalRealCost, rpp.MA_Sequence_ID, rpp.ProducedStdQuantity
            FROM
               (SELECT SUM(pl.MovementQty) AS ProducedQty, 
               MAX(C_CURRENCY_CONVERT(pl.ComponentCost, ?, ?, TO_DATE(p.movementdate), null, pl.ad_client_id, pl.ad_org_id)) AS ComponentCost, 
-              pp.M_ProductionPlan_ID, wrp.MA_Sequence_ID
+              pp.M_ProductionPlan_ID, wrp.MA_Sequence_ID,sum(sp.quantity) as ProducedStdQuantity
               FROM M_Production p
                 INNER JOIN M_ProductionPlan pp ON (p.M_Production_ID = pp.M_Production_ID)
                 INNER JOIN M_ProductionLine pl ON (pp.M_ProductionPlan_ID = pl.M_ProductionPlan_ID)
                 INNER JOIN MA_WRPhase wrp ON (pp.MA_WRPhase_ID = wrp.MA_WRPhase_ID)
+                LEFT OUTER JOIN MA_SequenceProduct sp 
+                ON (pl.M_Product_ID = sp.M_Product_ID AND wrp.MA_Sequence_ID = sp.MA_Sequence_ID)
               WHERE p.IsSOTrx = 'N'
               AND pl.ProductionType = '+'
               AND p.Processed = 'Y'
@@ -108,7 +110,7 @@
               GROUP BY pl.M_Product_ID, pl.M_ProductionPlan_ID
               HAVING SUM(pl.MovementQty) <> 0) rpn 
            ON (rpp.M_ProductionPlan_ID = rpn.M_ProductionPlan_ID) 
-           GROUP BY rpn.M_Product_ID, rpp.ComponentCost, rpp.MA_Sequence_ID) auxSeq
+           GROUP BY rpn.M_Product_ID, rpp.ComponentCost, rpp.MA_Sequence_ID, rpp.ProducedStdQuantity) auxSeq
         LEFT OUTER JOIN MA_SequenceProduct sp 
         ON (auxSeq.M_Product_ID = sp.M_Product_ID AND auxSeq.MA_Sequence_ID = sp.MA_Sequence_ID), M_Product
         WHERE auxSeq.M_Product_ID = M_Product.M_Product_ID