CI: merge back from main
authorRM packaging bot <staff.rm@openbravo.com>
Thu, 11 Jun 2015 20:40:59 +0000
changeset 26946 a14340555783
parent 26944 2a66cd73cfe8 (diff)
parent 26945 559a6242635c (current diff)
child 26947 4b256593c263
CI: merge back from main
src-db/database/sourcedata/AD_MODULE.xml
--- a/src-db/database/model/tables/M_TRANSACTION.xml	Thu Jun 11 20:23:04 2015 +0000
+++ b/src-db/database/model/tables/M_TRANSACTION.xml	Thu Jun 11 20:40:59 2015 +0000
@@ -182,6 +182,9 @@
       <foreign-key foreignTable="M_PRODUCTIONLINE" name="M_TRANSACTION_M_PRODUCTIONLINE">
         <reference local="M_PRODUCTIONLINE_ID" foreign="M_PRODUCTIONLINE_ID"/>
       </foreign-key>
+      <index name="M_TRANSACTION_CALCULATED" unique="false">
+        <index-column name="ISCOSTCALCULATED"/>
+      </index>
       <index name="M_TRANSACTION_INOUTLINE" unique="false">
         <index-column name="M_INOUTLINE_ID"/>
       </index>
@@ -197,6 +200,9 @@
       <index name="M_TRANSACTION_MOVEMENTLINE" unique="false">
         <index-column name="M_MOVEMENTLINE_ID"/>
       </index>
+      <index name="M_TRANSACTION_PROCESSED" unique="false">
+        <index-column name="ISPROCESSED"/>
+      </index>
       <index name="M_TRANSACTION_PRODUCTIONLINE" unique="false">
         <index-column name="M_PRODUCTIONLINE_ID"/>
       </index>
--- a/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 11 20:23:04 2015 +0000
+++ b/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 11 20:40:59 2015 +0000
@@ -22,7 +22,7 @@
 <!--0-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--0-->  <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
 <!--0-->  <REFERENCEDATAINFO><![CDATA[Standard document types for orders, invoices, etc. and settings]]></REFERENCEDATAINFO>
-<!--0-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
+<!--0-->  <VERSION_LABEL><![CDATA[dev]]></VERSION_LABEL>
 <!--0-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--0-->  <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
 <!--0--></AD_MODULE>
--- a/src/org/openbravo/service/importprocess/ImportEntryManager.java	Thu Jun 11 20:23:04 2015 +0000
+++ b/src/org/openbravo/service/importprocess/ImportEntryManager.java	Thu Jun 11 20:40:59 2015 +0000
@@ -188,7 +188,7 @@
   }
 
   public long getNumberOfQueuedTasks() {
-    return executorService.getQueue().size();
+    return executorService.getQueue() == null ? 0 : executorService.getQueue().size();
   }
 
   public long getNumberOfActiveTasks() {
@@ -238,9 +238,6 @@
    * Note will commit the session/connection using {@link OBDal#commitAndClose()}
    */
   public void createImportEntry(String id, String typeOfData, String json) {
-    // make sure that everything is flushed to the db before checking import entry
-    // content
-    OBDal.getInstance().flush();
     OBContext.setAdminMode(true);
     try {
       // check if it is not there already or already archived
@@ -398,7 +395,9 @@
     final OBContext prevOBContext = OBContext.getOBContext();
     OBContext.setOBContext("0", "0", "0", "0");
     try {
-      // no need to do client/org checks on these actions, as in error, do the least possible
+      // do not do org/client check as the error can be related to org/client access
+      // so prevent this check to be done to even be able to save org/client access
+      // checks
       OBContext.setAdminMode(false);
       ImportEntry importEntry = OBDal.getInstance().get(ImportEntry.class, importEntryId);
       if (importEntry != null && !"Processed".equals(importEntry.getImportStatus())) {
@@ -475,7 +474,8 @@
           try {
 
             // too busy, don't process, but wait
-            if (manager.executorService.getQueue().size() > (manager.maxTaskQueueSize - 1)) {
+            if (manager.executorService.getQueue() != null
+                && manager.executorService.getQueue().size() > (manager.maxTaskQueueSize - 1)) {
               doWait();
               // woken, re-start from beginning of loop
               continue;